Preview a credit note
Works out the lines, tax and total of a credit note, and how much of it lowers the amount owed, without saving it.
Works out the lines, tax and total of a credit note, and how much of it lowers the amount owed, without saving it.
Authorization
api-key API key for merchant integrations. Send as Authorization: Bearer <your key>.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/credit-notes/preview" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "string" }'{ "id": "cn_3Nf8a2kLmPq9", "object": "credit_note", "number": "INV-000012-CN1", "status": "issued", "type": "pre_payment", "invoiceId": "string", "customerId": "string", "currency": "EGP", "reason": "duplicate", "memo": "string", "effectiveAt": "string", "lines": [ { "id": "cnli_3Nf8a2kLmPq9", "object": "credit_note_line_item", "type": "invoice_line_item", "invoiceLineItemId": "string", "description": "string", "quantity": 0, "unitAmount": -9007199254740991, "amount": -9007199254740991, "discountAmount": -9007199254740991, "taxes": [ null ] } ], "amount": -9007199254740991, "amountShipping": -9007199254740991, "discountAmount": -9007199254740991, "subtotal": -9007199254740991, "subtotalExcludingTax": -9007199254740991, "total": -9007199254740991, "totalExcludingTax": -9007199254740991, "totalTaxes": [ { "amount": -9007199254740991, "taxableAmount": -9007199254740991, "taxBehavior": "exclusive", "taxRateDetails": {} } ], "prePaymentAmount": -9007199254740991, "postPaymentAmount": -9007199254740991, "outOfBandAmount": -9007199254740991, "refunds": [ { "refundId": "string", "amountRefunded": -9007199254740991 } ], "customerBalanceTransactionId": "string", "voidedAt": "string", "metadata": { "property1": null, "property2": null }, "merchantId": "string", "createdAt": "string", "updatedAt": "string"}Issue a credit note POST
Lowers the amount of an issued invoice. The credit first reduces what the customer still owes. For any part that was already paid, say where it goes: refundAmount, creditAmount and outOfBandAmount must add up to it.
Retrieve a credit note GET
Retrieves a credit note with its lines.