KashierDevelopersKashier Developers

Pay with token

curl -X POST "https://test-fep.kashier.io/v3/orders" \  -H "Content-Type: application/json" \  -d '{    "apiOperation": "PAY",    "paymentMethod": {      "type": "CARD",      "card": {        "cardToken": "00000000-0000-4000-8000-000000000001",        "securityCode": "",        "enable3DS": true      }    },    "installments": {      "plandId": ""    },    "origin": {      "id": ""    },    "connectedAccount": {      "merchantId": ""    },    "order": {      "reference": "",      "amount": "1",      "currency": "EGP",      "description": ""    },    "customer": {      "reference": ""    },    "interactionSource": "ECOMMERCE",    "reconciliation": {      "webhookUrl": "",      "merchantRedirect": "",      "redirect": true    },    "metaData": {},    "merchantId": "",    "timestamp": ""  }'

{  "response": {    "apiOperation": "PAY",    "operation": "pay",    "currency": "EGP",    "result": "SUCCESS",    "status": "CAPTURED",    "authenticationStatus": "AUTHENTICATION_NOT_IN_EFFECT",    "amount": 100,    "creationTime": "2023-10-16 12:00:49.746000+00:00",    "lastUpdatedTime": "2023-10-16 12:00:50.137000+00:00",    "merchantCurrency": "EGP",    "reference": "1697457648576",    "totalAuthorizedAmount": 100,    "totalCapturedAmount": 100,    "totalDisbursedAmount": 0,    "totalRefundedAmount": 0,    "authentication": {},    "paymentMethod": {      "type": "CARD",      "card": {        "cardBrand": "Mastercard",        "storedOnFile": "TO_BE_STORED",        "number": "512345******2346",        "nameOnCard": "John Doe",        "expiry": {          "month": "12",          "year": "25"        },        "cardToken": "00000000-0000-4000-8000-000000000007"      }    },    "metaData": {      "customerName": "John Doe",      "merchantWebhook": "https://your-call-back-url.com/webhook",      "redirect": true    },    "customer": {      "reference": "01000000000"    },    "timestamp": "2022-12-15 13:54:01.606000+00:00",    "reconciliation": {      "webhookUrl": "https://your-call-back-url.com",      "merchantRedirect": "https://your-call-back-url.com?paymentStatus=SUCCESS&cardDataToken=00000000-0000-4000-8000-000000000007&maskedCard=512345******2346&merchantOrderId=1697457648576&orderId=00000000-0000-4000-8000-000000000008&cardBrand=Mastercard&orderReference=TEST-ORD-XXXXXXXXX&transactionId=TX-XXXXXXXXXX&amount=100&currency=EGP&mode=test&signature=<hmac-sha256-hex>",      "redirect": true    },    "merchantId": "MID-XXXXX-XXX",    "order": {      "amount": 100,      "currency": "EGP",      "callbackURL": "https://your-call-back-url.com"    },    "merchantRedirectUrl": "https://your-call-back-url.com?paymentStatus=SUCCESS&cardDataToken=00000000-0000-4000-8000-000000000007&maskedCard=512345******2346&merchantOrderId=1697457648576&orderId=00000000-0000-4000-8000-000000000008&cardBrand=Mastercard&orderReference=TEST-ORD-XXXXXXXXX&transactionId=TX-XXXXXXXXXX&amount=100&currency=EGP&mode=test&signature=<hmac-sha256-hex>",    "method": "card",    "creationDate": "2023-10-16 15:00:48.946000+00:00",    "orderId": "00000000-0000-4000-8000-000000000008",    "merchantOrderId": "1697457648576",    "orderReference": "TEST-ORD-XXXXXXXXX",    "interactionSource": "MOTO",    "transactionId": "TX-XXXXXXXXXX",    "transactionResponseCode": "00",    "transactionResponseMessage": {      "en": "Approved",      "ar": "تمت الموافقة"    }  },  "messages": {    "en": "Approved",    "ar": "تمت الموافقة"  },  "status": "SUCCESS",  "showCaptcha": false}

Creates a new payment request using a saved card token. Send the Kashier-Hash header (order hash generated with HMAC SHA256 from your backend). With interactionSource: ECOMMERCE and 3DS enabled, the response contains an authentication.redirectUrl you should redirect to for the 3DS page; the final transaction response after 3DS processing is received via webhook. With MOTO, the payment is processed directly.

Authorization

kashierHash
Kashier-Hash<token>

A request hash you compute on your server — an HMAC SHA256 keyed with your Payment API Key — sent in the Kashier-Hash header. It is computed per request, so it is not a stored credential. See the hashing guide for the string to sign.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

POST
/v3/orders