Invoice Corrections

A correction invoice is a specific accounting document. It is issued by the seller in strictly defined situations, such as, for example, reducing or increasing the tax base or returning goods or granting a discount. Depending on the reason for issuing the correction, there are different ways of dealing with it.
The data that should be included in the corrective invoice are these are:
  • sequential number and date of issue;
  • data contained in the invoice to which the corrective invoice relates
  • date of issue;
  • buying and selling sides: seller and buyer,
  • the invoice number
  • name (type) of goods or services subject to correction;

Table of contents

Glossary

Name
Explanation
correctionType
Type of correction ("VALUABLE" "QUANTITATIVE”)
clientData: clientId tin clientType phone invoiceEmail
Buyer's data: Identifier number of buyer Type of buyer ("INDIVIDUAL" "ORGANIZATION”)
clientData addressData city country name postalCode street
Address of buyer
notes
invoice notes
payerData: clientId tin phone
payer data: Identifier number of payer
payerDataaddressData city country name postalCode street
address of payer
tenantData: tin
seller details:
tenantData addressData city country name postalCode street
address of seller
operatorData id name
operator assigned to the customer (this information is not displayed on the invoice correction) <uuid> for example - 00e9e304-e5df-450a-a861-0211c471096b
number
invoice correction number
customerPurchaseNumbers
the customer order number to which the invoice relates
totalPrices: netPrice grossPrice taxValue
number number number
paymentDate
payment deadline
saleDate
sale date
currencyCode
possible to choose: "AED" "AFN" "ALL" "AMD" "ANG" "AOA" "ARS" "AUD" "AWG" "AZN" "BAM" "BBD" "BDT" "BGN" "BHD" "BIF" "BMD" "BND" "BOB" "BOV" "BRL" "BSD" "BTN" "BWP" "BYR" "BZD" "CAD" "CDF" "CHF" "CLF" "CLP" "CNY" "COP" "CRC" "CUC" "CUP" "CVE" "CZK" "DJF" "DKK" "DOP" "DZD" "EGP" "ERN" "ETB" "EUR" "FJD" "FKP" "GBP" "GEL" "GHS" "GIP" "GMD" "GNF" "GTQ" "GYD" "HKD" "HNL" "HRK" "HTG" "HUF" "IDR" "ILS" "INR" "IQD" "IRR" "ISK" "JMD" "JOD" "JPY" "KES" "KGS" "KHR" "KMF" "KPW" "KRW" "KWD" "KYD" "KZT" "LAK" "LBP" "LKR" "LRD" "LSL" "LYD" "MAD" "MDL" "MGA" "MKD" "MMK" "MNT" "MOP" "MRO" "MUR" "MVR" "MWK" "MXN" "MXV" "MYR" "MZN" "NAD" "NGN" "NIO" "NOK" "NPR" "NZD" "OMR" "PAB" "PEN" "PGK" "PHP" "PKR" "PLN" "PYG" "QAR" "RON" "RSD" "RUB" "RWF" "SAR" "SBD" "SCR" "SDG" "SEK" "SGD" "SHP" "SLL" "SOS" "SRD" "SSP" "STD" "SYP" "SZL" "THB" "TJS" "TMT" "TND" "TOP" "TRY" "TTD" "TWD" "TZS" "UAH" "UGX" "USD" "USN" "USS" "UYU" "UZS" "VEF" "VND" "VUV" "WST" "XAF" "XAG" "XAU" "XBA" "XBB" "XBC" "XBD" "XCD" "XDR" "XFU" "XOF" "XPD" "XPF" "XPT" "XSU" "XTS" "XUA" "XXX" "YER" "ZAR" "ZMW”
bankAccountNumber
Bank account number
itemslinePrices: netPrice grossPrice taxValue
Information on payments for a particular product line on the invoice correction: number number number
itemstaxRate: name value
Tax information: Ex. 5%, NP etc. number, Tax rate in percentage value without symbol, ex. 5 instead of 5%. It could be also a floating point value
itemsitemPrices: netPrice grossPrice taxValue
Information about price for products number number number
itemsadditionalCosts type
Information about additional costs for products type of additional costs
additionalCosts itemPrices: netPrice grossPrice taxValue
Information about additional costs for products
additionalCostslinePrices: netPrice grossPrice taxValue
information on additional costs for product lines
paymentMethodData id name
payment method information Identifier number of payment name of information method

POST - add invoice correction

In order to add goods received note to ONe platform use POST /api/v1/invoices/integrations/auth-required/invoice-corrections. The diagram below shows the dependency of communicating with the API:
Image without caption
Example request:
json
curl -X POST "https://api-preprod.one.unity.pl/api/v1/invoices/integrations/auth-required/invoice-corrections" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}" { "correctionType": "VALUABLE", --required "notes": [ "string" ], "clientData": { --required "clientId": "org:7fe1fd60-2da4-49c1-a22e-950c630457b6", --required "tin": "11111111", "clientType": "ORGANIZATION", --required "addressData": { --required "city": "Wroclaw", --required "country": "Poland", --required "name": "Warehouse", --required "postalCode": "55-555", --required "street": "Leska" --required }, "phone": "11111111", "invoiceEmail": "example@b2b.one" }, "payerData": { "clientId": "org:e8104641-f655-42c0-9ed0-176a4fe8e604", "addressData": { "city": "Wroclaw", "country": "Poland", "name": "Warehouse", "postalCode": "55-555", "street": "Leska" }, "tin": "11111111111", "phone": "11111111111" }, "tenantData": { --required "addressData": { --required "city": "wroclaw", --required "country": "Polska", --required "name": "ONe Company", --required "postalCode": "55-342", --required "street": "Miedzyleska" --required }, "tin": "11111111" --required }, "operatorData": { "id": "86b86ebc-ba2f-4f47-bd46-e25803d81a0d", "name": "Kacper Kacprowicz" }, "number": "111/korekta", --required "customerPurchaseNumbers": [ --required "100/d" ], "documentDate": "2022-12-12", --required "totalPrices": { --required "netPrice": -110, --required "grossPrice": -10, --required "taxValue": -40 --required }, "paymentDate": "2022-12-12", --required "saleDate": "2022-12-12", --required "currencyCode": "PLN", --required "bankAccountNumber": "21434235231234", "items": [ --required { "lineNumber": 1, --required "splitPayment": true, "type": "PRODUCT", --required "itemName": "Programowany, bezprzewodowy regulator temperatury", --required "gtin": "534634523522", "sku": "091FLRFV2", --required "series": "SALUS", "manufacturer": "SALUS LIMITED", "notes": [ --required "example note" ], "linePrices": { --required "netPrice": 550, --required "grossPrice": 30, --required "taxValue": 20 --required }, "pkwiu": "58.13.10.0", "taxRate": { --required "name": "Tax", --required "value": 0.23 --required }, "itemPrices": { --required "netPrice": 990, --required "grossPrice": 90, --required "taxValue": 50 --required }, "discount": 10, --required "itemBasePrices": { "netPrice": 5, "grossPrice": 15, "taxValue": 5 }, "additionalCosts": [ --required { "type": "KGO", --required "itemPrices": { --required "netPrice": 8, --required "grossPrice": 9, --required "taxValue": 1 --required }, "linePrices": { --required "netPrice": 40, --required "grossPrice": 80, --required "taxValue": 0.23 --required } } ], "quantity": 5, --required "unit": "szt.", --required "orderReferenceNumber": "100/d", "orderReferenceLineNumber": 1, "goodsIssuedNoteNumber": "71/06/2022", "goodsIssuedNoteLineNumber": 1, "invoiceReferenceLineNumber": 1, --required "invoiceReferenceNumber": "FV/699/03/2022" --required } ], "paymentMethodData": { --required "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", --required "name": "example payment name" --required } }

DELETE single invoice correction

Use Delete /api/v1/invoices/integrations/auth-required/invoice-corrections to delete existing single invoice corrections.
The sequence diagram below shows the dependency of communicating with the API:
Image without caption
Use the parameter below to delete invoice correction:
  • number
Example request:
json
curl -X DELETE DELETE "https://api-preprod.one.unity.pl/api/v1/invoices/integrations/auth-required/invoice-corrections?number=9999%2F06%2F2022" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}"

POST - Initialise file uploading for invoice corrections

On the ONe platform, it is possible to send a document in the form of a PDF file to a specific goods issued notes. Use POST api/v1/invoices/integrations/auth-required/invoices-corrections/file-upload begin to receive parameters on the basis of which it will be possible to add a document to our server.
⚠️
To add the document to our server, use an external tool. For example Talend Api Tester. At the end of the description, we will show an example of this tool how to add a file to our server.
The sequence diagram below shows the dependency of communicating with the API:
Image without caption
Use the parameter to initialise file uploading for a specific document:
  • fileExtension
  • goodsReceivedNoteNumber
Example request:
json
curl -X POST "https://api-preprod.one.unity.pl/api/v1/invoices/integrations/auth-required/invoice-correction/file-upload-begin?fileExtension=pdf&number=9999%2F06%2F2022" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}"
In response you will receive information needed to add documents to our server
  • uploadUrl
  • uploadId
Example response:
json
{ "uploadUrl": "https://{link}", "uploadId": "a36b3639-4ec6-438b-a377-7b718e733105" }
When we get uploadUrland uploadId we can use tool to add documents to our server. Below we present how to do it using an Talend API Tester. 1 - method - PUT 2 - in headers - content-Type and choose application/pdf 3 - paste the link received in resonse to the request 4 - add file 5- press send
Image without caption
The document has been added to the server.

POST - Complete file uploading for invoice corrcetion

This endpoint is used to complete the process of adding a document to our server. Use this endpoint after physically adding documents to the server - POST /api/v1/invoices/integrations/auth-required/invoice-corrections/file-upload-complete.
The diagram below shows the dependency of communicating with the API:
Image without caption
Use the parameter below in query to find a specific goods received note:
  • uploadId
⚠️
uploadId it is possible to get from this endpoint (POST - Initialise file uploading for goods received note)
Example request:
json
curl -X POST "https://api-preprod.one.unity.pl/api/v1/invoices/integrations/auth-required/invoice-corrections/file-upload-complete?uploadId=fbe457b2-c090-436e-8e80-3473e4404819" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}"

GET single invoice corrections

There is possible to get specific invoice correction. Use GET/api/v1/invoices/integrations/auth-required/invoice-corrections/single using specific ID. The diagram below shows the dependence of communicating with the API:
Image without caption
Use the parameter in query below to get information about specific invoice correctionhttps://api-preprod.one.unity.pl/api/v1/invoices/integrations/auth-required/invoices/single?number=9999%2F06%2F2022":
  • number
Example request:
json
curl -X GET "https://api-preprod.one.unity.pl/api/v1/invoice-corrections/integrations/auth-required/invoices/single?number=9999%2F06%2F2022" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}"
In response you will receive information about specific invoice correction
Example response:
json
{ "correctionType": "VALUABLE", "clientData": { "clientId": "org:7fe1fd60-2da4-49c1-a22e-950c630457b6", "clientType": "ORGANIZATION", "addressData": { "city": "Wroclaw", "country": "Poland", "name": "Warehouse", "postalCode": "55-555", "street": "Leska" }, "tin": "11111111", "phone": "11111111", "invoiceEmail": "example@b2b.one" }, "payerData": { "clientId": "org:e8104641-f655-42c0-9ed0-176a4fe8e604", "addressData": { "city": "Wroclaw", "country": "Poland", "name": "Warehouse", "postalCode": "55-555", "street": "Leska" }, "tin": "11111111111", "phone": "11111111111" }, "tenantData": { "addressData": { "city": "wroclaw", "country": "Polska", "name": "ONe Company", "postalCode": "55-342", "street": "Miedzyleska" }, "tin": "11111111" }, "operatorData": { "id": "86b86ebc-ba2f-4f47-bd46-e25803d81a0d", "name": "Kacper Kacprowicz" }, "fileData": null, "number": "111/korekta", "customerPurchaseNumbers": [ "100/d" ], "documentDate": "2022-12-12", "totalPrices": { "netPrice": -110, "grossPrice": -10, "taxValue": -40 }, "paymentDate": "2022-12-12", "saleDate": "2022-12-12", "currencyCode": "PLN", "bankAccountNumber": "21434235231234", "notes": [ "string" ], "items": [ { "lineNumber": 1, "type": "PRODUCT", "itemName": "Programowany, bezprzewodowy regulator temperatury", "gtin": "534634523522", "sku": "091FLRFV2", "series": "SALUS", "manufacturer": "SALUS LIMITED", "notes": [ "example note" ], "linePrices": { "netPrice": 550, "grossPrice": 30, "taxValue": 20 }, "pkwiu": "58.13.10.0", "taxRate": { "value": 0.23, "name": "Tax" }, "itemPrices": { "netPrice": 990, "grossPrice": 90, "taxValue": 50 }, "discount": 10, "itemBasePrices": null, "additionalCosts": [ { "type": "KGO", "itemPrices": { "netPrice": 8, "grossPrice": 9, "taxValue": 1 }, "linePrices": { "netPrice": 40, "grossPrice": 80, "taxValue": 0.23 } } ], "quantity": 5, "unit": "szt.", "orderReferenceNumber": "100/d", "orderReferenceLineNumber": 1, "goodsReceivedNoteNumber": null, "goodsReceivedNoteLineNumber": null, "invoiceReferenceLineNumber": 1, "invoiceReferenceNumber": "007/06/2022" } ], "paymentMethodData": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "example payment name" }, "invoiceReferenceNumbers": [ "007/06/2022" ], "orderReferenceNumbers": [ "100/d" ], "goodsIssuedNoteReferenceNumbers": [], "goodsReceivedNoteReferenceNumbers": [] }

Powered by Notaku