POST /payments

This operation will initiate a new payment for a user and the response will include a unique PaymentID to track the status of the transaction.

Request

Initiating a payment is performed by posting to /payments with the following body:

{
  "amount": "string",
  "currencyCode": "string",
  "accountId": "string($guid)",
  "reference": "string",
  "returnUrl": "string",
  "countryCode": "string"
}
Header
Mandatory
Description

Authorization

Yes

Bearer token from /authentication/getToken

Body Field
Mandatory
Description

amount

Yes

The amount to request from the user in cents.

currencyCode

Yes

The payment currency to request from the user, e.g. DZAR

accountId

Yes

The unique ID of the merchant’s account to which to transfer the user’s payment to (if successful).

See Accounts for obtaining the correct accountId.

reference

Yes

A unique reference generated and supplied by your system. This reference will be displayed to the user should they have any queries for the payment.

returnUrl

No

The URL to redirect the user to once payment has been completed.

An id parameter will be appended to the returnUrl which can be used by the Merchant’s system to query the status of the Payment.

countryCode

Yes

The country code of the user who is requesting the payment. This is the Alpha-2 country code as defined by https://www.iban.com/country-codes

Sample Request
{
  "amount": "10000",
  "currencyCode": "DZAR",
  "accountId": "00000000-0000-0000-0000-000000000000",
  "reference": "ref12345678",
  "returnUrl": "https://redirect.merchant.com",
  "countryCode": "ZA"
}

Response

If successful, the operation will return a payment initiation response:

{
  "id": "string($guid)",
  "reference": "string",
  "amount": "string",
  "accountId": "string($guid)",
  "currencyCode": "string",
  "statusCode": int,
  "statusMessage": "string",
  "errorCode": int,
  "errorMessage": "string",
  "createdAt": "string($date-time)"
}
Field
Response Type
Description

id

string($guid)

The unique Payment ID generated by 6DOT50 to be used in subsequent user redirects and method calls.

reference

string

Same value from Request.

amount

string

Same value from Request.

accountId

string($guid)

Same value from Request.

currencyCode

string

Same value from Request.

statusCode

int

Status code for the transaction. See Payment Status Codes for more information.

statusMessage

string

A display message for the status code. See Payment Status Codes for messages.

errorCode

int

Error code for the transaction if it failed to create. See Payment Error Codes for more information

errorMessage

string

A display message for the error code. See Payment Error Codes for messages.

createdAt

string($date-time)

Time in UTC when the payment was created.

Sample Response
{
  "id": "009c3481-a65c-4afa-a950-1f5bce710493",
  "reference": "ref12345678",
  "amount": "10000",
  "accountId": "00000000-0000-0000-0000-000000000000",
  "currencyCode": "DZAR",
  "statusCode": 0,
  "statusMessage": "Payment is in progress",
  "errorCode": 0,
  "createdAt": "2022-09-26T11:40:47.33"
}

Last updated