Update a checkout session
Updates an open checkout session. Immutable fields (mode, uiMode, submitType, currency, expiresAfterMinutes) cannot be changed after creation.
Updates an open checkout session. Immutable fields (mode, uiMode, submitType, currency, expiresAfterMinutes) cannot be changed after creation.
Authorization
api-key API key for merchant integrations. Send as Authorization: Bearer <your key>.
In: header
Path Parameters
Checkout session ID
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
application/json
application/json
curl -X PATCH "https://example.com/checkout/sessions/string" \ -H "Content-Type: application/json" \ -d '{}'{ "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": 0, "currency": "EGP", "exchangeRate": 0, "exchangeRateId": "string", "amountSubtotal": 0, "amountTotal": 0, "amountDiscount": 0, "amountCollectedVat": 0, "amountPlatformFee": 0, "amountTax": 0 }, "afterCompletion": { "type": "redirect", "redirect": { "url": "string" }, "hostedConfirmation": { "customMessage": "string", "returnUrl": "string" } }, "cancelUrl": "string", "url": "string", "clientSecret": "string", "expiresAt": "string", "isExpired": true, "customerId": "string", "externalCustomerId": "string", "customer": { "id": "string", "type": "guest", "name": "string", "email": "string", "phone": "string", "address": { "city": "string", "country": "string", "line1": "string", "line2": "string", "postalCode": "string", "state": "string" }, "shipping": { "name": "string", "phone": "string", "address": {} }, "metadata": { "property1": null, "property2": null } }, "customerDetails": { "name": "string", "email": "string", "phone": "string", "billingDetails": { "name": "string", "email": "string", "phone": "string", "address": {} }, "shipping": { "name": "string", "phone": "string", "address": {} } }, "paymentIntentId": "string", "lineItems": [ { "id": "string", "quantity": 0, "price": {}, "adjustableQuantity": {}, "amountSubtotal": 0, "amountTotal": 0, "amountDiscount": 0, "amountTax": 0, "currency": "EGP", "description": "string", "presentmentDetails": {}, "availability": "available" } ], "customFields": [ { "key": "string", "label": "string", "type": "TEXT", "isOptional": true, "hasLimits": true, "limitType": "AT_MOST", "minCharacters": 0, "maxCharacters": 0, "dropdownOptions": [ null ], "text": {}, "numeric": {}, "dropdown": {} } ], "discounts": [ { "id": "string", "object": "discount", "coupon": { "appliesToProductIds": [], "metadata": {} }, "promotionCodeId": "string", "promotionCodeCode": "string", "checkoutSessionId": "string", "customerId": "string", "start": "string", "end": "string" } ], "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": { "primary": "string", "primaryForeground": "string", "background": "string", "foreground": "string", "border": "string", "input": "string", "ring": "string", "muted": "string", "mutedForeground": "string", "accent": "string", "accentForeground": "string", "destructive": "string" }, "fontFamily": "string" }, "locale": "auto", "paymentMethodTypes": [ { "type": "string", "displayName": "string", "category": "card", "minTransactionAmount": "string", "maxTransactionAmount": "string", "requiredCustomerFields": [ null ], "supportsRefund": true, "supportsPartialRefund": true, "supportsPartialCapture": true, "paymentConfirmation": "string" } ], "paymentMethodConfigurationId": "string", "fees": { "paymentMethodType": "string", "feeAmount": 0, "feePercentage": 0, "vatAmount": 0, "totalAmount": 0, "cardInfo": { "brand": "string", "isOnUs": true, "isInternational": true } }, "customerUpdate": { "address": "auto", "name": "auto", "shipping": "auto" }, "metadata": { "property1": null, "property2": null }, "merchantId": "string", "merchantName": "string", "merchantLogo": "string", "paymentLinkId": "string", "invoiceId": "string", "livemode": true, "paymentIntent": { "id": "string", "object": "payment_intent", "checkoutSessionId": "string", "amount": 0, "amountCapturable": 0, "amountReceived": 0, "currency": "EGP", "status": "REQUIRES_PAYMENT_METHOD", "createdAt": "string", "updatedAt": "string", "clientSecret": "string", "captureMethod": "string", "confirmationMethod": "string", "description": "string", "receiptEmail": "string", "canceledAt": "string", "shipping": { "address": {}, "name": "string", "phone": "string" }, "amountDetails": { "productAmount": 0, "tax": {}, "platformFees": {}, "tip": 0, "discount": 0 }, "presentmentDetails": { "amount": 0, "currency": "EGP", "exchangeRate": 0, "exchangeRateId": "string" }, "latestCharge": { "id": "string", "object": "charge", "amount": 0, "amountCaptured": 0, "amountRefunded": 0, "currency": "EGP", "createdAt": "2019-08-24T14:15:22Z", "status": "SUCCEEDED", "paid": true, "refunded": true, "captured": true, "capturedAt": "2019-08-24T14:15:22Z", "failureCode": "string", "failureMessage": "string", "receiptNumber": "string", "receiptUrl": "string", "receiptEmail": "string", "billingDetails": {}, "paymentMethodDetails": {}, "outcome": {}, "balanceTransaction": { "feeDetails": [] }, "presentmentDetails": {}, "refunds": [ null ], "paymentIntentId": "string", "paymentMethodId": "string", "calculatedStatementDescriptor": "string", "disputed": true, "externalChargeId": "string", "config": {}, "geocoding": {}, "session": {}, "merchantOrigin": "string", "merchantDomain": "string", "referrerDomain": "string", "referrerObservedAt": "2019-08-24T14:15:22Z", "processorCapabilities": {}, "activeHoldId": "string", "settlementModel": "aggregated" }, "charges": [ { "refunds": [] } ], "paymentMethod": { "id": "string", "object": "payment_method", "card": { "networks": {} }, "valu": {}, "fawry": {}, "billingDetails": {}, "type": "card", "createdAt": "2019-08-24T14:15:22Z" }, "customer": { "id": "string", "name": "string", "email": "string", "phone": "string" }, "nextAction": { "type": "redirect_to_url", "redirectToUrl": {}, "displayVoucherDetails": {} }, "metadata": { "property1": null, "property2": null }, "lastPaymentError": { "code": "string", "declineCode": "string", "networkDeclineCode": "string", "docUrl": "string", "message": "string", "merchantMessage": "string", "adviceCode": "confirm_card_data", "param": "string", "chargeId": "string", "paymentMethod": {}, "paymentMethodType": "string", "type": "api_error", "processorCode": "string", "processorMessage": "string" } }}Retrieve a checkout session GET
Retrieves an existing checkout session by ID. Returns full session data including clientSecret. Webhooks report status changes: do not poll this endpoint. See https://docs.xpay.app/en/integrate/webhooks/checking-session-status
Expire a checkout session POST
Expires an open checkout session. Expired sessions cannot be used for payment.