Choose who delivers a PIN
Have us deliver to a PIN's customer from now on, or stop and deliver yourself. The PIN's webhook is not changed.
POST
https://afropin.com/api/v1/brand/pins/delivery
HMAC-signed request with a unique Idempotency-Key header. Authentication
With an SDK
PHP
$afropin->brand->pins->setDelivery($params)Node.js
afropin.brand.pins.setDelivery(params)Python
afropin.brand.pins.set_delivery(params)Java
afropin.brand().pins().setDelivery(params)Body parameters
pin_id
uuid
Required
The PIN pin_id. It must belong to your account and to the mode of your API key.
handle_delivery
boolean
Required
true to have us send the customer the new code or balance after every top-up, spend and new code; false to deliver them yourself.
Active and frozen PINs can be changed; expired PINs cannot. Turning delivery on doesn't resend the current code: we can't, as we only keep its fingerprint. To get the customer a code from us now, follow it with Give a PIN a new code. How delivery works
Request
{
"pin_id": "e83f72e0-997c-4ca8-aee8-04a7423a1bd4",
"handle_delivery": true
}
Response 200
{
"ok": true,
"data": {
"pin_id": "e83f72e0-997c-4ca8-aee8-04a7423a1bd4",
"handle_delivery": true
}
}
Errors
Failed requests return a stable code with a translated message. Branch on code, never on the message.
422
validation_error
Some fields are missing or invalid
403
wrong_account_type
Your account type cannot use this endpoint
429
rate_limited
Too many requests. Wait a moment and try again
404
pin_not_found
No PIN has this id
403
pin_expired
This PIN has expired
500
internal_error
Something went wrong on our side. Try again; if it keeps happening, contact support
{
"ok": false,
"error": {
"code": "pin_not_found",
"message": "No PIN has this id",
"fields": null
}
}
All error codes →