HomeGuidesAPI Reference
API Reference

Split Payment

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

Initiate Hosted Checkout Session

This document details how to initiate a hosted checkout session, including split payment functionality, redirecting your customer to a secure Edfapay payment page while allowing payment distribution between multiple recipients.


Endpoint

POST https://app-api.edfapay.com/api/v1/payment-gateway/initiate

Content-Type: application/json


Authentication

All requests to this endpoint must include a valid X-API-KEY in the request header for authentication. The X-API-KEY must be sent from the server side and should not be exposed on the client side.

How to generate API key


Request Parameters

FieldTypeRequiredDescription
orderIdStringYesUnique identifier for the order.
currencyStringYesCurrency code in ISO 4217 format (e.g., SAR).
amountDecimalYesTotal amount to be charged.
suppliersArrayOptionalList of suppliers for split payment distribution.
customerDetailsObjectYesCustomer information object.
addressObjectOptionalCustomer address object.
recurringInitStringOptionalSet to Y to initialize recurring payment.
successUrlStringYesThe endpoint to which the customer is redirected after a successful 3DS authentication.
failureUrlStringYesThe endpoint to which the customer is redirected after a failed 3DS authentication.
activityIdIntegerOptionalSadad payment activity identifier.
issueDateDateOptionalInvoice issue date (YYYY-MM-DD).
expireDateDateOptionalInvoice expiration date (YYYY-MM-DD).

Suppliers Object

FieldTypeRequiredDescription
recipientIdStringYesRecipient identifier from Payout → Recipient Management.
amountDecimalYesAmount to be transferred to the specified recipient.

The recipientId can be obtained from Payout → Recipient Management in the merchant dashboard.

Customer Details Object

FieldTypeRequiredDescription
nameStringYesFull name of the customer.
emailStringYesEmail address of the customer.
phoneStringYesCustomer phone number.
idNumberStringOptionalCustomer identification number.
idTypeStringOptionalType of identification (e.g., Passport, National ID).
taxNumberStringOptionalCustomer tax number (if applicable).

Address Object

FieldTypeDescription
countryStringCountry code (e.g., SA).
stateStringState or governorate.
cityStringCity name.
addressStringFull address details.
zipStringPostal/ZIP code

Example cURL Request

curl --location 'https://app-api.edfapay.com/api/v1/payment-gateway/initiate' \
--header 'accept: */*' \
--header 'X-API-KEY: <Your API Key>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "orderId": "12345",
  "currency": "SAR",
  "amount": 100,
  "suppliers": [
    {
      "recipientId": "659d66d3-e4f6-49c9-b393-ee5f94a99491",
      "amount": 2
    }
  ],
  "customerDetails": {
    "name": "John Doe",
    "email": "[email protected]",
    "phone": "+9665234678"
  },
  "address": {
    "country": "SA",
    "state": "Riyadh",
    "city": "Riyadh",
    "address": "10 Olaya St, Floor 5, Apt 12"
  },
  "recurringInit": "N",
  "successUrl": "https://www.success.com/",
  "failureUrl": "https://www.failure.com/"
}'

📘

If issueDate is not provided or is null, it will default to the current date. If expireDate is not provided or is null, it will automatically be set to 7 days after the issueDate.


Successful Response

{
    "code": 200,
    "message": "Success",
    "errorCode": null,
    "data": {
        "redirectUrl": "https://app.edfapay.com/pay/checkout?sessionId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
}
👍

redirectUrl: Redirect your customer to this URL to complete the payment.

Responses

Language
URL
LoadingLoading…
Response
Choose an example:
text/plain