Discount
A Discount records a single application of a Coupon to a specific Checkout Session, PaymentIntent, or Customer. Where a Coupon is the reusable template, a Discount captures the concrete redemption: which Coupon was applied, when it became active, when it expires, and (when applicable) which Promotion Code the customer entered to claim it.
A Discount records a single application of a Coupon to a specific Checkout Session, PaymentIntent, or Customer. Where a Coupon is the reusable template, a Discount captures the concrete redemption: which Coupon was applied, when it became active, when it expires, and (when applicable) which Promotion Code the customer entered to claim it.
{ "id": "string", "object": "discount", "coupon": { "id": "string", "object": "coupon", "createdAt": "string", "discountType": "percentage", "percentOff": 0, "amountOff": 0, "currency": "EGP", "duration": "once", "durationInMonths": 0, "name": "string", "maxDiscountAmount": 0, "minValue": 0, "maxRedemptions": 0, "customerMaxRedemptions": 0, "timesRedeemed": 0, "redeemBy": "string", "valid": true, "active": true, "appliesToProductIds": [ "string" ], "metadata": { "property1": null, "property2": null }, "merchantId": "string", "livemode": true }, "promotionCodeId": "string", "promotionCodeCode": "string", "checkoutSessionId": "string", "customerId": "string", "start": "string", "end": "string"}Customer
A Customer represents a buyer you do business with. Use Customers to save payment methods for reuse, track lifetime spend, attach metadata for your CRM, and group related Charges, Refunds, and Checkout Sessions under a single record. Give a Customer your own ID as `externalId` and pass it as `externalCustomerId` on later checkout sessions, so you never need to store the XPay customer ID.
Invoice Payment
An Invoice Payment is one payment made on an invoice. An invoice can have several: one per part payment or installment. A payment is backed by a PaymentIntent when the customer paid online, or by a payment record when the merchant recorded money received outside XPay, such as cash or a cheque. Money returned from a payment is shown in amountRefunded and documented by a credit note; the payment's status stays paid.