KashierDevelopersKashier Developers
Direct API integration

Pay with token

Create new payment requests using a saved card token

To create new payment requests using the card token.

Step 1: Generate hash

The order hash is generated as explained in Request hashing. Append .{customerReference} to the signed string — it is required whenever card.save, card.cardToken, or card.agreement is present, and omitting it returns 403 INVALID_HASH_CHECK.

Step 2: Pay

EndpointValue
URLhttps://test-fep.kashier.io/v3/orders/
MethodPOST

Whenever you are ready for production, use the following production API endpoint URL instead.

EndpointValue
URLhttps://fep.kashier.io/v3/orders/
MethodPOST
curl -X 'POST' 'https://test-fep.kashier.io/v3/orders/' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Kashier-Hash: your_generated_hash' \
  -d '{
  "apiOperation": "PAY",
  "paymentMethod": {
      "type": "CARD",
      "card": {
          "cardToken": "",
          "securityCode": ""
      }
  },
  "installments": {
      "planId": ""
  },
  "connectedAccount": {
      "merchantId": ""
  },
  "order": {
      "reference": "",
      "amount": "1",
      "currency": "EGP",
      "description": ""
  },
  "customer": {
      "reference": ""
  },
  "interactionSource": "ECOMMERCE",
  "reconciliation": {
      "webhookUrl": "",
      "merchantRedirect": "",
      "redirect": true
  },
  "metaData": {},
  "merchantId": "MID-12-34"
}'

Body structure

{
  "apiOperation": "PAY",
  "paymentMethod": {
      "type": "CARD",
      "card": {
          "cardToken": "123456789123456789",
          "securityCode": "",
          "enable3DS": true
      }
  },
  "installments": {
      "planId": ""
  },
  "origin": {
      "id": ""
  },
  "connectedAccount": {
      "merchantId": ""
  },
  "order": {
      "reference": "",
      "amount": "1",
      "currency": "EGP",
      "description": ""
  },
  "customer": {
      "reference": ""
  },
  "interactionSource": "ECOMMERCE",
  "reconciliation": {
      "webhookUrl": "",
      "merchantRedirect": "",
      "redirect": true
  },
  "metaData": {},
  "merchantId": ""
}

Body parameters

ParameterRequiredDescription
apiOperationYesPAY — a confirmation purchase against the saved token.
paymentMethod.typeYesCARD.
paymentMethod.card.cardTokenYesThe saved card token, used instead of paymentMethod.card.number.
paymentMethod.card.securityCodeConditionalThe CVV. Mandatory when interactionSource is ECOMMERCE.
paymentMethod.card.enable3DSNoWhether to run 3D Secure. Note it belongs inside card, not directly under paymentMethod.
installments.planIdNoSend only when paying with an installment plan. Omit installments entirely for a regular charge.
origin.idNoOrigin identifier. Required only when you send an origin object.
connectedAccount.merchantIdNoThe Sub Merchant / connected account MID (MID-…) to charge on behalf of.
order.referenceYesYour merchant order ID.
order.amountYesOrder amount.
order.currencyYesEGP, USD, GBP, or EUR.
order.descriptionNoOrder description.
customer.referenceYesShopper reference. Mandatory for any token payment — and it must also be appended to the signed hash string.
interactionSourceYesMust be ECOMMERCE, MOTO, or RECURRING for direct card pay. Use RECURRING for merchant-initiated repeat charges.
reconciliation.webhookUrlNoPer-request server webhook URL.
reconciliation.merchantRedirectNoWhere to send the customer afterwards (their receipt page).
reconciliation.redirectNoRedirect to merchantRedirect once the transaction completes.
metaDataNoArbitrary data echoed back in responses and webhooks.
merchantIdYesYour merchant ID (MID-…).

timestamp

Some published samples of this request also carry a top-level timestamp field. It is not in any documented field reference, so whether Kashier requires it is unconfirmed — we have left it out of the samples above rather than assert it. If you already send it, keeping it does no harm.

Headers

KeyDescription
Kashier-Hash (String)Order hash generated in Request hashing.

Full parameter and response reference → Pay with token.

Responses

With interactionSource MOTO (non-3DS), the payment is processed and captured directly.

With Ecommerce and 3DS, after a successful response you should redirect to authentication.redirectUrl to generate the 3DS page. As soon as the transaction has completed, it will redirect to merchantRedirectUrl if reconciliation.redirect was equal to true; otherwise use 3D Secure handling.

You can receive the transaction response after 3DS processing in the webhook.

On this page