Create Payment Link

POST /payment/checkout/intiate — create a hosted checkout session.

Creates a hosted checkout session and returns a URL for the customer to pay.

Recommended flow: This is the primary hosted checkout endpoint on Fin staging. After a successful call, redirect the customer to redirectUrl from the response.

Request

MethodPOST
URL{baseUrl}/payment/checkout/intiate
AuthHeader x-api-key (required)

Fin staging base URL: https://fin-api.digetpay.com/v1

Legacy path: The path is spelled intiate. Do not use /payment/checkout/session on Fin unless your environment explicitly exposes it.

Body parameters

ParameterTypeRequiredDefaultDescription
merchantOrderIdstringYesYour unique order/reference ID
amountnumberYesPayment amount (min 0.01, max 2 decimal places)
currencystringNoSARISO currency code
customerNamestringNoCustomer display name (pre-fills checkout)
customerEmailstringNoCustomer email (valid email format)
customerPhonestringYesCustomer mobile — required; sent to gateway for Apple Pay
successUrlstring (URL)YesRedirect after successful payment
failureUrlstring (URL)YesRedirect after failed payment

Critical — Apple Pay: If customerPhone is missing or empty, the API returns 400 and Apple Pay will not work. Always send a valid Saudi mobile number at link creation.

Phone number format

Use a Saudi mobile number without country code when possible:

RecommendedExample
Local 9-digit501223324
With leading zero0501223324

Request payload

{
  "merchantOrderId": "PAY-1781872369616",
  "amount": 0.2,
  "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"
}

Best practice: Store merchantOrderId in your database before calling the API so you can reconcile webhooks and status responses later.

Responses

{
  "success": {
    "status": 201,
    "body": {
      "id": "70471003-64ee-4ae7-a639-e607b45e890b",
      "redirectUrl": "https://fin-admin.digetpay.com/pay/checkout?sessionId=70471003-64ee-4ae7-a639-e607b45e890b"
    }
  }
}
FieldDescription
success.body.idCheckout session UUID — store for reconciliation
success.body.redirectUrlOpen this URL in browser for customer payment

Important: success.body.id is the checkout session ID. Do not use it for status or refund APIs — use the gateway transaction ID after payment completes. See Transaction Identifiers.

Session behaviour

ItemDetail
Session lifetime48 hours by default
Payable statesPENDING, FAILED (retry allowed)
After successSession status → PAID
Payment methodsCard (incl. 3DS), saved cards, Apple Pay (Safari)

On Fin staging, expect redirectUrl to point to https://fin-admin.digetpay.com/pay/checkout. Production checkout domains may differ per merchant configuration.


Did this page help you?