API documentation
Method list
Test your request
Changelog


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
original_invoice_idintOriginal invoice identifier
return_order_idintReturn order identifier
series_idint(optional) Series numbering identifier
date_sellint(optional) Sell date in unix timestamp
correcting_reasonint(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_itemsbool(optional) Whether to correct invoice items (0 - no, 1 - yes)
correcting_databool(optional) Whether to correct invoice data (0 - no, 1 - yes)
invoice_fullnamestring(optional) Full name for the invoice
invoice_companystring(optional) Company name
invoice_addressstring(optional) Address
invoice_postcodestring(optional) Postal code
invoice_citystring(optional) City
invoice_statestring(optional) State/Province
invoice_country_codestring(optional) Country code (e.g. PL)
invoice_nipstring(optional) Tax ID number
itemsarray(optional) Array of items to correct. If order_product_id is not provided, item will be added as new position at the end
fv_paymentstring(optional) Payment method
fv_personstring(optional) Issuer name



Output data
The method returns the data in JSON format.
statusvarchar(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_idintID of the added invoice.



Sample
Input data:
Output data:
A sample request in PHP: