docs

Payment Intent

A PaymentIntent tracks the full lifecycle of collecting one payment from your customer: from creation, through authorization and 3-D Secure, to capture and final outcome. We recommend creating one PaymentIntent per order: you can inspect its history of Charge attempts, watch its `status` as it transitions, and reference the successful Charge it ultimately produces. PaymentIntents are the object that the hosted Checkout and xpay.js drive on the client to complete a payment.

{
  "id": "string",
  "object": "payment_intent",
  "checkoutSessionId": "string",
  "checkoutSession": {
    "id": "string",
    "object": "checkout.session",
    "createdAt": "string",
    "updatedAt": "string",
    "mode": "payment",
    "uiMode": "hosted",
    "submitType": "PAY",
    "customerCreation": "always",
    "status": "open",
    "paymentStatus": "paid",
    "currency": "EGP",
    "amountSubtotal": 0,
    "amountTotal": 0,
    "totalDetails": {
      "amountDiscount": 0,
      "amountShipping": 0,
      "amountTax": 0,
      "amountPlatformFee": 0,
      "amountCollectedVat": 0
    },
    "presentmentDetails": {
      "amount": 80000,
      "currency": "KWD",
      "exchangeRate": 168.2,
      "exchangeRateId": "exr_3gQWCqaDsihr09Fi5MfwXL",
      "amountSubtotal": 100000,
      "amountTotal": 80000,
      "amountDiscount": 20000,
      "amountCollectedVat": 11200,
      "amountPlatformFee": 0,
      "amountTax": 0
    },
    "afterCompletion": {},
    "cancelUrl": "string",
    "url": "string",
    "clientSecret": "string",
    "expiresAt": "string",
    "customerId": "string",
    "customer": {
      "id": "string",
      "type": "guest",
      "name": "string",
      "email": "string",
      "phone": "string",
      "address": {},
      "shipping": {},
      "metadata": {}
    },
    "customerDetails": {
      "name": "string",
      "email": "string",
      "phone": "string",
      "billingDetails": {},
      "shipping": {}
    },
    "paymentIntentId": "string",
    "paymentIntent": {
      "id": "string",
      "object": "payment_intent",
      "checkoutSessionId": "string",
      "checkoutSession": {
        "afterCompletion": {},
        "paymentIntent": {},
        "lineItems": [],
        "customFields": [],
        "discounts": [],
        "paymentMethodTypes": [],
        "metadata": {}
      },
      "amount": 0,
      "amountCapturable": 0,
      "amountReceived": 0,
      "currency": "EGP",
      "status": "string",
      "createdAt": "2025-03-25T12:00:00.000Z",
      "updatedAt": "2025-03-25T12:00:00.000Z",
      "clientSecret": "string",
      "captureMethod": "string",
      "confirmationMethod": "string",
      "description": "string",
      "receiptEmail": "string",
      "canceledAt": "2025-03-25T12:00:00.000Z",
      "shipping": {
        "address": {}
      },
      "amountDetails": {
        "tax": {},
        "platformFees": {}
      },
      "presentmentDetails": {},
      "latestCharge": {
        "billingDetails": {},
        "paymentMethodDetails": {},
        "outcome": {},
        "balanceTransaction": {},
        "refunds": [],
        "config": {},
        "geocoding": {},
        "session": {},
        "processorCapabilities": {}
      },
      "charges": [
        {}
      ],
      "paymentMethod": {
        "card": {},
        "valu": {},
        "billingDetails": {}
      },
      "customer": {},
      "nextAction": {
        "redirectToUrl": {}
      },
      "metadata": {},
      "lastPaymentError": {
        "paymentMethod": {}
      }
    },
    "lineItems": [
      {}
    ],
    "customFields": [
      {
        "dropdownOptions": []
      }
    ],
    "discounts": [
      {}
    ],
    "allowPromotionCodes": true,
    "nameCollection": true,
    "billingAddressCollection": true,
    "shippingAddressCollection": true,
    "phoneNumberCollection": true,
    "feeConfig": {
      "feesPassThrough": true,
      "vatCollectionEnabled": true,
      "vatCollectionRate": 0,
      "source": "session"
    },
    "brandingSettings": {
      "colorMode": "light",
      "borderStyle": "rounded",
      "spacing": "condensed",
      "inputSize": "small",
      "inputStyle": "flat",
      "formLayout": "compact",
      "colors": {},
      "fontFamily": "string"
    },
    "locale": "en",
    "paymentMethodTypes": [
      {
        "requiredCustomerFields": []
      }
    ],
    "paymentMethodConfigurationId": "string",
    "fees": {
      "paymentMethodType": "string",
      "feeAmount": 0,
      "feePercentage": 0,
      "vatAmount": 0,
      "totalAmount": 0,
      "cardInfo": {}
    },
    "customerUpdate": {
      "address": "auto",
      "name": "auto",
      "shipping": "auto"
    },
    "metadata": {},
    "merchantId": "string",
    "merchantName": "string",
    "merchantLogo": "string",
    "paymentLinkId": "string",
    "livemode": true
  },
  "amount": 0,
  "amountCapturable": 0,
  "amountReceived": 0,
  "currency": "EGP",
  "status": "string",
  "createdAt": "2025-03-25T12:00:00.000Z",
  "updatedAt": "2025-03-25T12:00:00.000Z",
  "clientSecret": "string",
  "captureMethod": "string",
  "confirmationMethod": "string",
  "description": "string",
  "receiptEmail": "string",
  "canceledAt": "2025-03-25T12:00:00.000Z",
  "shipping": {
    "address": {
      "city": "string",
      "country": "string",
      "line1": "string",
      "line2": "string",
      "postalCode": "string",
      "state": "string"
    },
    "name": "string",
    "phone": "string"
  },
  "amountDetails": {
    "productAmount": 0,
    "tax": {
      "amount": 0,
      "rateBps": 0
    },
    "platformFees": {
      "amount": 0,
      "vatAmount": 0
    },
    "tip": 0,
    "discount": 0
  },
  "presentmentDetails": {
    "amount": 80000,
    "currency": "KWD",
    "exchangeRate": 168.2,
    "exchangeRateId": "exr_3gQWCqaDsihr09Fi5MfwXL"
  },
  "latestCharge": {
    "id": "string",
    "object": "charge",
    "amount": 0,
    "amountCaptured": 0,
    "amountRefunded": 0,
    "currency": "EGP",
    "createdAt": "2025-03-25T12:00:00.000Z",
    "status": "string",
    "paid": true,
    "refunded": true,
    "captured": true,
    "capturedAt": "2025-03-25T12:00:00.000Z",
    "failureCode": "string",
    "failureMessage": "string",
    "receiptUrl": "string",
    "receiptEmail": "string",
    "billingDetails": {
      "address": {},
      "email": "string",
      "name": "string",
      "phone": "string"
    },
    "paymentMethodDetails": {
      "type": "string",
      "card": {
        "threeDSecure": {},
        "wallet": {}
      },
      "valu": {}
    },
    "outcome": {
      "networkStatus": "string",
      "reason": "string",
      "riskLevel": "string",
      "riskScore": 0,
      "sellerMessage": "string",
      "type": "string"
    },
    "balanceTransaction": {
      "id": "txn_abc123",
      "object": "balance_transaction",
      "amount": 22604,
      "availableOn": "string",
      "createdAt": "string",
      "currency": "EGP",
      "description": "string",
      "fee": 912,
      "net": 21692,
      "feeDetails": [
        {}
      ],
      "status": "AVAILABLE",
      "type": "CHARGE",
      "reportingCategory": "string",
      "exchangeRate": 0,
      "source": "string",
      "payoutBatch": {},
      "paymentIntentId": "string",
      "merchantId": "string"
    },
    "presentmentDetails": {
      "amount": 80000,
      "currency": "KWD",
      "exchangeRate": 168.2,
      "exchangeRateId": "exr_3gQWCqaDsihr09Fi5MfwXL"
    },
    "refunds": [
      {}
    ],
    "paymentIntentId": "string",
    "paymentMethodId": "string",
    "calculatedStatementDescriptor": "string",
    "disputed": true,
    "externalChargeId": "string",
    "config": {
      "vatCollectionEnabled": true,
      "vatCollectionRate": 0,
      "collectedVatAmount": 0,
      "platformFeePassThrough": true,
      "merchantFeeDeduction": 0
    },
    "geocoding": {
      "ipAddress": "string",
      "location": {}
    },
    "session": {
      "browser": "string",
      "browserVersion": "string",
      "platform": "string",
      "device": "string",
      "deviceVendor": "string",
      "deviceModel": "string"
    },
    "processorCapabilities": {
      "supportsRefund": true,
      "supportsPartialRefund": true
    },
    "activeHoldId": "hld_xxx",
    "settlementModel": "aggregated"
  },
  "charges": [
    {
      "id": "string",
      "object": "charge",
      "amount": 0,
      "amountCaptured": 0,
      "amountRefunded": 0,
      "currency": "EGP",
      "createdAt": "2025-03-25T12:00:00.000Z",
      "status": "string",
      "paid": true,
      "refunded": true,
      "captured": true,
      "capturedAt": "2025-03-25T12:00:00.000Z",
      "failureCode": "string",
      "failureMessage": "string",
      "receiptUrl": "string",
      "receiptEmail": "string",
      "billingDetails": {
        "address": {}
      },
      "paymentMethodDetails": {
        "card": {},
        "valu": {}
      },
      "outcome": {},
      "balanceTransaction": {
        "feeDetails": [],
        "payoutBatch": {}
      },
      "presentmentDetails": {},
      "refunds": [
        {}
      ],
      "paymentIntentId": "string",
      "paymentMethodId": "string",
      "calculatedStatementDescriptor": "string",
      "disputed": true,
      "externalChargeId": "string",
      "config": {},
      "geocoding": {
        "location": {}
      },
      "session": {},
      "processorCapabilities": {},
      "activeHoldId": "hld_xxx",
      "settlementModel": "aggregated"
    }
  ],
  "paymentMethod": {
    "id": "string",
    "object": "string",
    "card": {
      "brand": "string",
      "country": "string",
      "displayBrand": "string",
      "expMonth": 0,
      "expYear": 0,
      "fingerprint": "string",
      "funding": "string",
      "last4": "string",
      "networks": {},
      "regulatedStatus": "string",
      "threeDSecureUsage": {},
      "wallet": {}
    },
    "valu": {
      "loanNumber": "string",
      "tenure": 0,
      "emi": "string",
      "downPayment": "string",
      "financedAmount": "string",
      "firstEmiDueDate": "string",
      "lastInstallmentDate": "string"
    },
    "billingDetails": {
      "address": {},
      "email": "string",
      "name": "string",
      "phone": "string"
    },
    "type": "card",
    "createdAt": "2025-03-25T12:00:00.000Z"
  },
  "customer": {
    "id": "string",
    "name": "string",
    "email": "string",
    "phone": "string"
  },
  "nextAction": {
    "type": "string",
    "redirectToUrl": {
      "url": "string",
      "returnUrl": "string"
    }
  },
  "metadata": {},
  "lastPaymentError": {
    "code": "string",
    "declineCode": "string",
    "networkDeclineCode": "string",
    "docUrl": "string",
    "message": "string",
    "merchantMessage": "string",
    "adviceCode": "string",
    "param": "string",
    "chargeId": "string",
    "paymentMethod": {},
    "paymentMethodType": "string",
    "type": "string",
    "processorCode": "string",
    "processorMessage": "string"
  }
}