KashierDevelopersKashier Developers

Create payment session

curl -X POST "https://test-api.kashier.io/v3/payment/sessions" \  -H "Content-Type: application/json" \  -d '{    "expireAt": "2030-01-01 00:00:00+00:00",    "maxFailureAttempts": 3,    "paymentType": "credit",    "amount": "100.00",    "currency": "EGP",    "order": "8f64saf6sa4",    "merchantRedirect": "https://your-website.com/redirect",    "display": "en",    "type": "one-time",    "allowedMethods": "card,wallet",    "redirectMethod": null,    "iframeBackgroundColor": "#FFFFFF",    "metaData": {      "customKey": "customValue",      "displayNotes": {        "key": "value"      }    },    "merchantId": "YOUR_MID",    "failureRedirect": false,    "brandColor": "#FF5733",    "defaultMethod": "card",    "description": "Payment for order ORD123456",    "manualCapture": false,    "customer": {      "email": "[email protected]",      "reference": "894321"    },    "saveCard": "optional",    "retrieveSavedCard": true,    "interactionSource": "ECOMMERCE",    "enable3DS": true,    "serverWebhook": "https://your_webhook_url",    "notes": "Special handling required"  }'
{  "status": "CREATED",  "failureAttempts": 0,  "capturedAmount": 0,  "refundedAmount": 0,  "_id": "67adc07584f10c00121f6739",  "merchantId": "MID-XXXX-XXXX",  "expireAt": "2025-01-28 17:27:32.359000+00:00",  "maxFailureAttempts": 3,  "paymentParams": {    "display": "en",    "paymentType": "credit",    "amount": "100.00",    "currency": "EGP",    "order": "as8f64a5",    "merchantRedirect": "https://your-website.com/redirect",    "type": "one-time",    "allowedMethods": "card,wallet",    "redirectMethod": null,    "iframeBackgroundColor": "#FFFFFF",    "metaData": {      "customKey": "customValue",      "displayNotes": {        "key": "value"      }    },    "failureRedirect": false,    "brandColor": "#FF5733",    "defaultMethod": "card",    "description": "Payment for order ORD123456",    "manualCapture": false,    "customer": {      "email": "[email protected]",      "reference": "894321"    },    "saveCard": "optional",    "retrieveSavedCard": true,    "interactionSource": "ECOMMERCE",    "enable3DS": true,    "serverWebhook": "https://your_webhook_url",    "notes": "Special handling required",    "hash": "3a657fb8e653c024a4abdd31b084082c8bbd4d9438f98451ca42a4abeb49766d",    "storeName": "Demo",    "store": "Demo"  },  "apiKey": "{{merchant_api_key}}",  "history": [    {      "status": "CREATED",      "date": "2025-02-13 09:50:45.360000+00:00"    }  ],  "webhookNotifications": [],  "createdAt": "2025-02-13 09:50:45.363000+00:00",  "updatedAt": "2025-02-13 09:50:45.363000+00:00",  "__v": 0,  "sessionUrl": "https://payments.kashier.io/session/67adc07584f10c00121f6739?mode=test"}

Creates a payment session. The response contains a sessionUrl that is used to redirect the customer to the payment page — you can use it as the src attribute in a link or iframe.

Authorization

secretKey apiKey
Authorization<token>

Merchant secret key used to identify the merchant, obtained from Kashier's dashboard. Pass the raw secret key value in the Authorization header (NOT a "Bearer" token).

In: header

api-key<token>

API key obtained from the merchant dashboard under the Integrations section. The API key is different for the live and test environments, so make sure to use the correct one for each.

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

POST
/v3/payment/sessions