Gateway-hosted redirect with optional split payments. Requires DigetPay DG… format API key.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Creates a hosted checkout session and returns a payment URL that redirects the customer to the DigetPay hosted checkout page.
Recommended API: This is the primary endpoint for Hosted Checkout integrations. After creating the payment session, redirect the customer to the returned
redirectUrl.
Endpoint
| Method | POST |
| URL | {baseUrl}/payment/checkout/intiate |
| Authentication | x-api-key (Required) |
Fin Staging Base URL
https://fin-api.digetpay.com/v1Legacy endpoint name: The endpoint path is intentionally spelled
intiate. Do not replace it withinitiate.
Integration Flow
sequenceDiagram
autonumber
participant Merchant as Your Server
participant API as DigetPay API
participant Customer
participant Checkout as Hosted Checkout
Merchant->>API: POST /payment/checkout/intiate
API-->>Merchant: id + redirectUrl
Merchant->>Customer: Redirect
Customer->>Checkout: Complete payment
Checkout-->>Customer: successUrl / failureUrl
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
merchantOrderId | string | ✅ | Unique merchant order reference. |
amount | number | ✅ | Payment amount. Minimum 0.01. |
currency | string | No | Currency code. Default SAR. |
customerName | string | No | Customer name shown during checkout. |
customerEmail | string | No | Customer email address. |
customerPhone | string | ✅ | Customer mobile number. Required for Apple Pay. |
successUrl | URL | ✅ | Redirect after successful payment. |
failureUrl | URL | ✅ | Redirect after failed payment. |
Important:
customerPhoneis required. Requests without a valid phone number return 400 Bad Request and Apple Pay will not be available.
Phone Number Format
| Format | Example |
|---|---|
| Local | 501223324 |
| With leading zero | 0501223324 |
Request Example
{
"merchantOrderId": "PAY-1781872369616",
"amount": 0.20,
"currency": "SAR",
"customerName": "Mohamed Ashour",
"customerEmail": "[email protected]",
"customerPhone": "501223324",
"successUrl": "https://fin-admin.digetpay.com/pay/checkout/success",
"failureUrl": "https://fin-admin.digetpay.com/pay/checkout/failure"
}Store
merchantOrderIdin your system before creating the payment session so it can be matched with webhook notifications and transaction status responses.
Responses
{
"id": "70471003-64ee-4ae7-a639-e607b45e890b",
"redirectUrl": "https://fin-admin.digetpay.com/pay/checkout?sessionId=70471003-64ee-4ae7-a639-e607b45e890b"
}{
"statusCode": 400,
"message": [
"customerPhone should not be empty"
],
"error": "Bad Request"
}{
"statusCode": 401,
"message": "Missing API key",
"error": "Unauthorized"
}Response Fields
| Field | Description |
|---|---|
id | Checkout session identifier. |
redirectUrl | Hosted checkout page where the customer completes payment. |
The returned
idis the checkout session ID, not the payment transaction ID.To query payment status or process refunds, use the gateway transaction ID returned after payment completion.
See Transaction Identifiers for more details.
Session Behavior
| Item | Value |
|---|---|
| Session Lifetime | 48 Hours |
| Initial Status | PENDING |
| After Successful Payment | PAID |
| Payment Methods | Cards, Mada, Apple Pay, Saved Cards |
The returned
redirectUrlpoints to the DigetPay hosted checkout page. On Fin Staging the domain is:https://fin-admin.digetpay.com/pay/checkout
Best Practices
- Generate a unique
merchantOrderIdfor every payment. - Always send
customerPhone. - Never consider the redirect as the final payment result.
- Verify every payment using the Transaction Status API or Webhooks.
- Store the gateway transaction ID after payment for refunds and future operations.
