Credit Note Generation
Learn about required fields and additional requirements for credit notes.
Credit note generation requires Vertex Invoice IQ. The service generates tax-compliant digital invoices for requests with saleMessageType set to INVOICE.
Request
See Mandatory Fields for more information about required fields, additional requirements, and restrictions. For customization and invoice required fields, see Invoice Generation.
| Field | Value | Notes |
|---|---|---|
lineItems[] | — | — |
lineItems[].extendedPrice | This value requires a negative amount. | — |
lineItems[].lineItemDescription | This value includes the refund description included on the credit note. | — |
lineItems[].lineItemNumber | The lineItems[].lineItemNumber of the line from the original transaction to refund. | Required to associate the refund with a specific lineItems. You can obtain this value from the response to the original transaction. The request is rejected if it references a nonexistent lineItems. |
originalTransactionId | The transactionId of the transaction for which the credit note is generated. | Required to associate the refund with a specific transaction. This field is optional when the refund request's transactionId follows the format:
For example, if the original transaction has Otherwise, this field is required. |
Use the same customer and seller information from the original transaction, as well as the same lineItems[] details that may affect taxation, such as product.value and product.productClass.
A refund effectively calculates a negative transaction, including negative taxes and amounts. Changing these details may therefore affect the result.
Response
See Invoice Generation. The response uses the same format. The only difference is that the generated document is a credit note rather than an invoice.
Example
Example request, given the original transaction:
{
"customer": {
"destination": {
"country": "PL"
}
},
"currency": {
"isoCurrencyCodeAlpha": "EUR"
},
"deliveryTerm": "SUP",
"lineItems": [
{
"extendedPrice": 10,
"lineItemDescription": "Some goods",
},
{
"extendedPrice": 100,
"lineItemDescription": "Some other goods",
}
],
"saleMessageType": "INVOICE",
"seller": {
"company": "test_seller",
"physicalOrigin": {
"country": "PL"
},
"taxRegistrations": [
{
"isoCountryCode": "PL"
}
]
},
"transactionId": "183712894719871231234",
"transactionType": "SALE"
}We can create a refund for the first line item:
{
"customer": {
"destination": {
"country": "PL"
}
},
"currency": {
"isoCurrencyCodeAlpha": "EUR"
},
"deliveryTerm": "SUP",
"lineItems": [
// only the first line is refunded
{
"extendedPrice": -10,
"lineItemDescription": "Some refund reason",
"lineItemNumber": 1
}
],
"saleMessageType": "INVOICE",
"seller": {
"company": "test_seller",
"physicalOrigin": {
"country": "PL"
},
"taxRegistrations": [
{
"isoCountryCode": "PL"
}
]
},
// id of the previous transaction plus a new one for this request
// it could be simplified to use a refund transactionId format, like this:
// "tranactionId": "183712894719871231234_R1" rendering the originalTransactionId not needed
"originalTransactionId": "183712894719871231234",
"transactionId": "183712894719871231235",
"transactionType": "SALE"
}Updated 11 days ago
