Authentication
3 endpoints. Every call is POST https://api.useburj.com/v1/<path> with a JSON body.
Send the login code
/loginSends 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
phonenumberstringrequiredRegistered phone number, any usual format (05…, +966…)
loginTypestringrequiredprodortestprodtest
Errors
It can also return RATE_LIMITED (429) and INTERNAL_ERROR (500). See all error codes.
Exchange the code for an access token
/enterReturns 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
phonenumberstringrequiredSame number as /login
verifyCodestringrequiredThe 6-digit code
loginTypestringrequiredprodortestprodtest
Errors
AUTH_WRONG_OTPHTTP 401Incorrect 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
/accesstoken/refreshIssues 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.