Process a card payment from your backend (PCI DSS required). If result is REDIRECT, send the customer to 3-D Secure by rendering html or redirecting to redirect_url. Save trans_id: you send it to the S2S Transaction Status and S2S Refund endpoints.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Process a card payment directly from your backend using the Embedded Integration flow. This endpoint supports both sale and authorization-only transactions, and automatically handles 3-D Secure authentication when required.
PCI DSS Required
This endpoint accepts raw cardholder data. Your backend must be PCI DSS compliant and card data must never be collected or transmitted from client-side JavaScript.
Request Hash Required
Every Direct Sale request must include a valid
hashgenerated on your backend. See the hash generation section in the Embedded Integration Overview.
Request
| Method | POST |
| URL | https://api.digetpay.com/v1/payment/s2s/sale |
| Authentication | Header x-api-key (Test API Key or Live API Key) |
The same URL is used in Test Mode and Live Mode. Your API key decides the mode.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
orderId | string | Yes | Your unique order reference |
amount | number | Yes | Payment amount |
currency | string | Yes | ISO currency code (for example SAR) |
paymentMethod | string | Yes | Payment method. Use card |
auth | string | Yes | N = Sale • Y = Authorization Only |
saveToken | string | No | Y = save the card as a token for recurring payments • N = do not save |
card | object | Yes | Card details (see below) |
customer | object | Yes | Customer information (see below) |
successUrl | string | Yes | Redirect URL after successful 3DS (HTTPS) |
failureUrl | string | Yes | Redirect URL after failed 3DS (HTTPS) |
hash | string | Yes | Request signature |
card object
card object| Parameter | Type | Required | Description |
|---|---|---|---|
cardNumber | string | Yes | Card number, digits only |
cardHolder | string | Yes | Name on the card |
cardExpiryMonth | string | Yes | Two-digit expiry month, e.g. 01 |
cardExpiryYear | string | Yes | Four-digit expiry year, e.g. 2039 |
cardCvv | string | Yes | Card security code |
customer object
customer object| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Customer full name |
email | string | Yes | Customer email. Also used in the request hash |
phone | string | Yes | Customer phone number, e.g. +966501223324 |
idNumber | string | No | Customer national ID or Iqama number |
Generate the request hash immediately before sending the request. The hash must match the card number, customer email, and merchant API key used in the request.
Request Example
This example uses a DigetPay Test Card and works with your Test API Key.
{
"orderId": "TEST-S2S-0001",
"amount": 0.11,
"currency": "SAR",
"paymentMethod": "card",
"auth": "N",
"saveToken": "N",
"customer": {
"name": "Ahmed Emad Abd-Alfatah",
"email": "[email protected]",
"phone": "+966501223324",
"idNumber": "1234567890"
},
"card": {
"cardNumber": "5123450000000008",
"cardHolder": "Ahmed Emad Abd-Alfatah",
"cardExpiryMonth": "01",
"cardExpiryYear": "2039",
"cardCvv": "100"
},
"successUrl": "https://yourstore.com/payment/success",
"failureUrl": "https://yourstore.com/payment/failure",
"hash": "COMPUTED_MD5_HASH"
}Never log or store full card numbers or CVV values. Sensitive payment data should only exist in memory during request processing. Use Test Cards only with your Test API Key, and never use real cards or real customer data in Test Mode.
Responses
{
"code": 200,
"message": "Success",
"data": {
"result": "ACCEPTED",
"paymentId": "c09fba3c-59e2-434a-9ec1-5d2e71a44a8d",
"status": "APPROVED",
"html": null
}
}{
"code": 200,
"message": "Success",
"errorCode": null,
"data": {
"result": "REDIRECT",
"action": "SALE",
"status": "PENDING",
"amount": "0.11",
"currency": "SAR",
"order_id": "TEST-S2S-0001",
"trans_id": "07077294930390230372",
"trans_date": "2026-10-21 07:54:25",
"transactionId": "58288e7a-33ad-4091-9716-20a9b0c3a088",
"paymentId": "07077294930390230372",
"acquirerPaymentId": "07077294930390230372",
"rrn": "07077294930390230372",
"card_brand": "Mastercard",
"merchant_name": null,
"decline_reason": null,
"Card": {
"Number": "512345xxxxxx0008",
"ExpiryMonth": "01",
"ExpiryYear": "39",
"Brand": "Mastercard",
"PanType": "Card",
"Issuer": "TEST BANK",
"Token": "",
"NameOnCard": "Ahmed Emad Abd-Alfatah",
"IssuerCountry": "SAU",
"FundingMethod": "credit",
"ProductName": "Mastercard",
"IsValidCard": null,
"Is3DSVerified": false
},
"result_url": "https://yourstore.com/payment/success?paymentId=07077294930390230372&Id=07077294930390230372",
"html": "<!DOCTYPE html>...</html>",
"redirect_url": "https://pay.digetpay.com/..."
}
}{
"code": 200,
"message": "Success",
"data": {
"result": "DECLINED",
"paymentId": "c09fba3c-59e2-434a-9ec1-5d2e71a44a8d",
"status": "DECLINED",
"declineReason": "Insufficient funds",
"html": null
}
}{
"statusCode": 400,
"message": "Invalid request hash",
"error": "Bad Request"
}{
"statusCode": 401,
"message": "Missing API key",
"error": "Unauthorized"
}Response Fields
| Field | Description |
|---|---|
result | Payment result. REDIRECT means the customer must complete 3-D Secure (see below) |
action | Operation type: SALE (auth: N) or authorization (auth: Y) |
status | Gateway payment status, e.g. PENDING, APPROVED, DECLINED |
amount | Payment amount |
currency | Payment currency |
order_id | Your orderId from the request |
transactionId | DigetPay transaction ID (UUID) |
paymentId | Payment ID from the processor. Also returned as trans_id and acquirerPaymentId |
trans_date | Transaction date and time |
rrn | Retrieval Reference Number, when available |
card_brand | Card brand, e.g. Visa, Mastercard, Mada |
decline_reason | Reason for a declined payment, when available |
Card | Masked card details: number, expiry, brand, issuer, funding method. Token is filled when saveToken is Y |
Card.Is3DSVerified | true after 3-D Secure has been completed |
result_url | Your successUrl or failureUrl, where the customer returns after 3-D Secure |
html | Self-submitting HTML page that sends the customer to 3-D Secure |
redirect_url | 3-D Secure page URL. Use it instead of html if you prefer a direct redirect |
When
resultisREDIRECT: send the customer to 3-D Secure, either by renderinghtmlin the customer's browser or by redirecting the browser toredirect_url. The payment staysPENDINGuntil 3-D Secure is completed. Do not fulfill the order until you confirm the result with the Transaction Status API. The redirect to yoursuccessUrland webhooks are notifications, not proof of payment.
Store both
transactionIdandpaymentIdwith your order. You need them for Status, Capture, Void, Recurring and refunds, and for reconciliation.

