Credit Note
A Credit Note lowers the amount of an issued invoice without changing the invoice itself. It first reduces what the customer still owes (prePaymentAmount). Anything beyond that was already paid (postPaymentAmount) and goes back to the customer by a refund, as customer credit, or outside XPay. Refunding a payment of an invoice directly also writes its credit note.
A Credit Note lowers the amount of an issued invoice without changing the invoice itself. It first reduces what the customer still owes (prePaymentAmount). Anything beyond that was already paid (postPaymentAmount) and goes back to the customer by a refund, as customer credit, or outside XPay. Refunding a payment of an invoice directly also writes its credit note.
{ "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"}Coupon
A Coupon defines a reusable discount you can apply to Checkout Sessions and PaymentIntents. Coupons can grant either a percentage off (`percentOff`) or a fixed amount off (`amountOff`), and can apply once, forever, or repeating for a number of billing cycles. You can also cap how many times a Coupon may be redeemed and when it expires. Coupons are the reusable template. Each concrete application of a Coupon to a customer's purchase is recorded as a Discount. To give customers a redeemable code (e.g. `SUMMER25`) instead of applying the Coupon directly, create one or more Promotion Codes that map to this Coupon — a single Coupon can have many Promotion Codes, each with its own per-code restrictions. You receive `coupon.*` and `promotion_code.*` webhook events for each as they are created or changed.
Customer Balance Transaction
A Customer Balance Transaction is one change to a customer's balance. The balance always equals the sum of its transactions. A negative balance is credit, used up by the customer's next invoice.