KashierDevelopersKashier Developers

Create token

curl -X POST "https://test-fep.kashier.io/v3/cards/tokens" \  -H "Content-Type: application/json" \  -d '{    "merchantId": "YOUR_MID",    "customerReference": "CUST-001",    "paymentMethod": {      "type": "CARD",      "card": {        "number": "5123456789012346",        "expiry": {          "month": "12",          "year": "25"        },        "nameOnCard": "John Doe",        "securityCode": "123"      }    },    "customer": {      "reference": "CUST-001"    }  }'
{  "status": "SUCCESS",  "messages": {    "en": "Card is tokenized successfully",    "ar": "Card is tokenized successfully"  },  "response": {    "paymentMethod": {      "type": "CARD",      "card": {        "number": "512345********2346",        "cardToken": "00000000-0000-4000-8000-000000000001",        "cardDataToken": "00000000-0000-4000-8000-000000000001",        "cvvToken": "00000000-0000-4000-8000-000000000002",        "agreement": {          "type": "perm",          "id": "00000000-0000-4000-8000-000000000003"        }      }    }  }}

Saves a card and returns a reusable cardToken you can charge later with Pay with token. Send the raw card details once; Kashier stores them and hands back only the token and a masked card number, so your systems never have to keep the PAN. The request must carry a Kashier-Hash header: an HMAC SHA256 hash of the path /?tokenization={merchantId}.{customerReference}, generated from your backend with your secret. Use only those parameters in the hash creation. The securityCode (CVV) you submit is exchanged for a single-use cvvToken.

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.

The card to save, plus the customer it belongs to.

Response Body

application/json

application/json

application/json

POST
/v3/cards/tokens