addInvoiceCorrection
The method allows to issue an order invoice correction.
Either original_invoice_id or return_order_id must be provided.
If return_order_id is provided, all other fields will be ignored (except series_id) and invoice will be created with data from the return order.
If field is optional and not provided, it will be set according to the series settings or default values.
Input parameters
Output data:
A sample request in PHP:
original_invoice_id | int | Original invoice identifier |
return_order_id | int | Return order identifier |
series_id | int | (optional) Series numbering identifier |
date_sell | int | (optional) Sell date in unix timestamp |
correcting_reason | int | (optional) Reason for correction - 1: prepayments return - 2: compulsory discounts - 3: price increase after invoicing - 4: refund the buyer the amount of undue - 5: return the goods - 6: mistakes as to price, rate, amount of tax on invoices or position - 7: correcting buyer's address - 8: withdrawal from the contract - 9: other reason - fill in in the comments |
correcting_items | bool | (optional) Whether to correct invoice items (0 - no, 1 - yes) |
correcting_data | bool | (optional) Whether to correct invoice data (0 - no, 1 - yes) |
invoice_fullname | string | (optional) Full name for the invoice |
invoice_company | string | (optional) Company name |
invoice_address | string | (optional) Address |
invoice_postcode | string | (optional) Postal code |
invoice_city | string | (optional) City |
invoice_state | string | (optional) State/Province |
invoice_country_code | string | (optional) Country code (e.g. PL) |
invoice_nip | string | (optional) Tax ID number |
items | array | (optional) Array of items to correct. If order_product_id is not provided, item will be added as new position at the end |
fv_payment | string | (optional) Payment method |
fv_person | string | (optional) Issuer name |
Output data
The method returns the data in JSON format.
status | varchar(30) | SUCCESS - request executed correctly ERROR - an error occurred during an API request. Error details will be described in 2 additional returned fields: error_message and error_code |
invoice_id | int | ID of the added invoice. |
Sample
Input data:Output data:
A sample request in PHP: