API reference

Authentication

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

Send the login code

POST
/login
No token

Sends a 6-digit code by SMS / WhatsApp to the partner's registered phone number. loginType picks the environment: prod (real money) or test (sandbox).

Body

  • phonenumberstring
    required

    Registered phone number, any usual format (05…, +966…)

  • loginTypestring
    required

    prod or test

    prod
    test

Errors

It can also return RATE_LIMITED (429) and INTERNAL_ERROR (500). See all error codes.

Exchange the code for an access token

POST
/enter
No token

Returns the access token of the chosen environment. Send it on every other call as Authorization: Bearer <token>. The token does not expire; rotate it with /accesstoken/refresh.

Body

  • phonenumberstring
    required

    Same number as /login

  • verifyCodestring
    required

    The 6-digit code

  • loginTypestring
    required

    prod or test

    prod
    test

Errors

  • AUTH_WRONG_OTP
    HTTP 401

    Incorrect verification code. Ask for a new code with /login and try again.

It can also return RATE_LIMITED (429) and INTERNAL_ERROR (500). See all error codes.

Rotate the access token

POST
/accesstoken/refresh

Issues a new token and invalidates the old one immediately. Update every server that uses it.

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.