Sending Requests On Behalf Of
Some integrations need to perform actions for multiple end users. If that’s your case, you can send API requests on behalf of an end user instead of your API account.
Introduction
As an API customer, you may need to send requests on behalf of your end users.
This functionality allows you to manage end users within the API by including the X-On-Behalf header in your requests.
To use this feature, you must first register the end user and complete their KYC verification.
Once verified, you will receive the end account's ID, which can be used to perform operations on their behalf.
If you simply want to send API requests as yourself, you can omit this header.
How it works
To act on behalf of an end user, include the X-On-Behalf header in your request. This header tells Okoora that the request should be executed in the context of a specific end user.
Before you can use X-On-Behalf You must first:
X-On-Behalf You must first:- Setup the new connected account
- Complete KYC\B verification for that user
After the user is verified, you’ll receive an account ID. You’ll use that ID in the X-On-Behalf header for future requests.
Example of sending a request on behalf of a verified end user:
// Example request:
POST /api/v1/Converts/Create
Authorization: Bearer <TOKEN>
Content-Type: application/json
X-On-Behalf: <{ connected_account_id }> // optional
{
"buy": {
"currency": "EUR",
"amount": 1000
},
"charge": {
"currency": "USD",
"amount": 1100
}
}
// Example response:
{
"requestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"buy": {
"currency": "EUR",
"amount": 1000
},
"charge": {
"currency": "USD",
"amount": 1100
},
"exchangeRate": 1.1
}
Possible Errors
{
"title": "Forbidden",
"status": 403,
"detail": "The provided X-On-Behalf account ID is not authorized."
}{
"title": "BadRequest",
"status": 400,
"detail": "Invalid format for X-On-Behalf header."
}Updated 20 days ago
What’s Next
Enable webhooks (recommended)
Use webhooks to receive status updates automatically and avoid polling.