Embedded Tokenization Sale

Charges a saved card token. Get the token from Card.Token of a Direct Sale made with saveToken: "Y". A declined charge also returns HTTP 200: the charge succeeded only when data.status is SUCCESS.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Charge a customer with a saved card token from an earlier Embedded (S2S) payment. Use it for recurring or repeat payments without asking the customer to enter their card again.

📘

Get a token first: Make a Direct Sale payment with "saveToken": "Y". When the payment succeeds, the token is returned in Card.Token (for example TKN-...). Store it securely on your backend.

Flow

sequenceDiagram
    autonumber
    participant Merchant as Your Server
    participant DigetPay as DigetPay API
    participant Gateway as Payment Gateway

    Note over Merchant: Direct Sale with saveToken: "Y" returned Card.Token
    Merchant->>DigetPay: POST /payment/s2s/tokenization/sale
    Note right of Merchant: orderId, amount, currency, token
    DigetPay->>Gateway: Charge saved card
    Gateway-->>DigetPay: Payment result
    DigetPay-->>Merchant: Result

Request

MethodPOST
URLhttps://api.digetpay.com/v1/payment/s2s/tokenization/sale
AuthHeader x-api-key (Test API Key or Live API Key, required)

Use the API key of the same mode (Test or Live) that created the token.

Body parameters

FieldTypeRequiredDescription
orderIdstringYesYour unique order reference for this charge
amountnumberYesAmount to charge
currencystringYesISO currency code, e.g. SAR
tokenstringYesSaved card token from Card.Token of the original Direct Sale
successUrlstringYesHTTPS URL where the customer returns after the payment
🚧

Important: Use a new, unique orderId for every charge. The token can be charged more than once, but each charge is a separate order.

Request payload

{
  "orderId": "SUB-2026-10-0001",
  "amount": 0.11,
  "currency": "SAR",
  "token": "TKN-00000000-0000-0000-0000-000000000000",
  "successUrl": "https://yourstore.com/payment/callback"
}
❗️

Security: Never expose the card token in browser JavaScript, URLs, mobile applications, or logs. Store it securely on your backend.

Responses

{
  "code": 200,
  "message": "Success",
  "errorCode": null,
  "data": {
    "transactionId": "edf02325-b1e0-48e8-bfb2-a910aa2125a3",
    "paymentId": "07077295180390238873",
    "order_id": "SUB-2026-10-0002",
    "status": "SUCCESS",
    "amount": "0.11",
    "currency": "SAR",
    "paymentFlow": "TOKENIZATION",
    "Card": {
      "NameOnCard": "Ahmed Emad Abd-Alfatah",
      "Number": "512345xxxxxx0008",
      "Token": "TKN-00000000-0000-0000-0000-000000000000",
      "ExpiryMonth": "01",
      "ExpiryYear": "39",
      "Brand": "Mastercard",
      "Issuer": "Test Bank",
      "FundingMethod": "credit"
    },
    "operationType": "PAY",
    "transactionType": "TOKENIZATION",
    "invoice": {
      "id": "7295180",
      "status": "PAID",
      "reference": "2026001567",
      "externalIdentifier": "SUB-2026-10-0002",
      "creationDate": "2026-10-21T08:19:21.5807867Z",
      "expirationDate": "2026-10-24T08:19:21.5807867Z"
    },
    "transaction": {
      "id": "130955",
      "status": "SUCCESS",
      "paymentId": "07077295180390238873",
      "referenceId": "629408130955",
      "trackId": "21-10-2026_3902388",
      "authorizationId": "130955",
      "paymentMethod": "VISA/MASTER",
      "transactionDate": "2026-10-21T08:19:22.3386814Z",
      "networkTransactionId": "777123456789",
      "error": {
        "message": "",
        "responseCode": "00"
      }
    },
    "result_url": "https://yourstore.com/payment/callback?paymentId=07077295180390238873&Id=07077295180390238873"
  }
}

Response fields

A declined charge still returns HTTP 200 and code: 200. Always check data.status: the charge succeeded only when it is SUCCESS.

FieldDescription
messageSuccess, or the decline reason when the charge fails
data.transactionIdDigetPay transaction ID (UUID)
data.paymentIdPayment ID for this charge. Use it for Transaction Status and Refund
data.order_idYour orderId from the request
data.statusPayment status: SUCCESS, FAILED or PENDING
data.amount / currencyCharged amount and currency
data.paymentFlowTOKENIZATION for charges made with a saved token
data.CardMasked card details and the Token used
data.transactionTypeTOKENIZATION
data.invoiceInvoice reference, status (PAID when successful) and dates for this charge
data.transactionProcessor transaction details: authorizationId, referenceId, networkTransactionId, transactionDate
data.transaction.errorDecline details: message and the card network responseCode (00 = approved)
data.result_urlYour successUrl with the payment ID added

Confirm the payment: Before fulfilling the order, verify the charge with Transaction Status.

📘

Best practice: Save the returned payment reference for reconciliation, refunds, and transaction tracking.

🚧

If the token becomes invalid, expires, or the card is blocked by the issuer, the charge is declined. Ask the customer to pay again with a Direct Sale and "saveToken": "Y" to get a new token.


Body Params
string
required

Unique order reference for this charge

number
required
string
required
string
required

Card.Token from a Direct Sale made with saveToken Y

uri
required
Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json