POST
/
initSession
curl --request POST \
  --url https://dashu.sa/api/external/initSession \
  --header 'Content-Type: application/json' \
  --data '{
  "apiKey": "<string>",
  "data": {
    "Suppliers": [
      {}
    ]
  },
  "test": true
}'
{
  "success": true,
  "test": false,
  "paymentURL": "https://dashu.sa/api/external/pay?hash=h3qds2paiy-fko9bgd0et-mj94pv32tn"
}

Query Parameters

apiKey
string
required

The API Key of your account.

data
object
required
test
boolean

Set this property to true to send the request to the development environment.

{
  "success": true,
  "test": false,
  "paymentURL": "https://dashu.sa/api/external/pay?hash=h3qds2paiy-fko9bgd0et-mj94pv32tn"
}

Response properties

success
boolean
required

A boolean value indicates the response status.

test
boolean
required

A boolean value indicates the development environment status.

paymentURL
string
required

The payment URL that you’ll use to redirect the cusotmer to complete the payment. It’s a link for a hosted page that will provide multiple payment methods that can be choosed by the customer to pay the invoice.

Error Codes

Here’s a list of possible error codes of this endpoint.

CodeDescription
1Missing or invalid api key
2CallBackUrl is a required parameter.
3UserDefinedField is a required parameter.
4InvoiceValue is a required parameter.
5Suppliers is a required parameter.
6ErrorUrl is a required parameter.
7CallBackUrl should be a valid URL.
8UserDefinedField should be an array.
9InvoiceValue should be greater than zero.
10Suppliers should be an array.
11ErrorUrl should be a valid URL.