API reference

Balance & top-up

4 endpoints. Every call is POST https://api.useburj.com/v1/<path> with a JSON body.

Top-up limits

POST
/topup/config

Minimum / maximum in USD and SAR, and sandbox: true on the test account.

Body

Send an empty JSON object: {}

Errors

Like every authenticated endpoint, it can also return AUTH_UNAUTHORIZED (401), RATE_LIMITED (429) and INTERNAL_ERROR (500). See all error codes.

Create a payment link

POST
/topup/create

A MyFatoorah link (mada, cards, Apple Pay) in SAR. In the sandbox it is a simulated payment page with Pay / Fail buttons. After paying, the payer is sent to callbackUrl?paymentId=….

Body

  • amountnumber
    required

    Amount

  • currencystring
    optional

    USD (default) or SAR

  • languagestring
    optional

    AR (default) or EN

  • callbackUrlstring
    optional

    https URL to return to after paying

  • errorUrlstring
    optional

    https URL after a failed payment (defaults to callbackUrl)

Errors

Like every authenticated endpoint, it can also return AUTH_UNAUTHORIZED (401), RATE_LIMITED (429) and INTERNAL_ERROR (500). See all error codes.

Confirm a payment

POST
/topup/check

Send paymentId (from the callback URL) or invoiceId. The balance is credited once, when the payment is confirmed. Returns the status and the current balance.

Body

  • invoiceIdstring
    optional

    From /topup/create

  • paymentIdstring
    optional

    From the callback URL

Errors

Like every authenticated endpoint, it can also return AUTH_UNAUTHORIZED (401), RATE_LIMITED (429) and INTERNAL_ERROR (500). See all error codes.

Top-up history

POST
/topup/history

Newest first. paymentUrl is set while the link is unpaid.

Body

  • statusstring
    optional

    PENDING, CAPTURED, EXPIRED, CANCELED, AMOUNT_MISMATCH

  • limitinteger
    optional

    Default 50, max 200

Errors

Like every authenticated endpoint, it can also return AUTH_UNAUTHORIZED (401), RATE_LIMITED (429) and INTERNAL_ERROR (500). See all error codes.