Authentication
Every server call sends the API secret, Account ID, and Channel ID together.
Authentication
Copy all three from API Keys and send them on every server call. Content-Type: application/json.
| Field | Where | Rules |
|---|---|---|
api_secret | API secret | Also the key for webhook HMAC. Rotate it on API Keys if it leaks. |
account_id | Account ID | BP-XXXX-XXXX from API Keys. Your invoice id is account_reference. |
channel_id | Channel ID | Public id such as BP23356. It must be an active channel on that Account ID. Alias payment_channel_id. |
JSON body
{
"api_secret": "YOUR_API_SECRET",
"account_id": "BP-XXXX-XXXX",
"channel_id": "BP23356"
}
GET calls (payment status, B2C balance, B2C status) take the same three fields on the query string.
When a call is rejected
| HTTP | What happened | What to fix |
|---|---|---|
401 | The three fields were missing or did not match this account. | Send api_secret, account_id, and channel_id from the same API Keys card. |
422 | The channel is inactive or belongs to another account. | Use a Channel ID listed for that Account ID. List channels. |
The dashboard uses the signed-in session and csrf. That path is for the dashboard, not for your server.