Add a store
Register a store or kiosk where you sell PINs. Pass its ID as store_id to record which location made each sale.
POST
https://afropin.com/api/v1/reseller/stores
HMAC-signed request with a unique Idempotency-Key header. Authentication
With an SDK
PHP
$afropin->reseller->stores->create($params)Node.js
afropin.reseller.stores.create(params)Python
afropin.reseller.stores.create(params)Java
afropin.reseller().stores().create(params)Body parameters
title
string
Required
max 255
Store name. Saved in title case.
address
string
Required
max 255
Street address.
latitude
numeric
Required
-90 to 90
Latitude of the store.
longitude
numeric
Required
-180 to 180
Longitude of the store.
country
string
Required
ISO2
ISO 3166-1 alpha-2 country code, for example NG.
state
string
Required
max 255
State code within country, for example LA for Lagos.
city
string
Required
max 255
City.
postal_code
string
Required
max 255
Postal or ZIP code. It must be valid for country.
Response fields
idLocation ID. Send it as
store_id when you issue or top up a PIN.latitude, longitudeReturned as strings.
title, address, country, state, city, postal_codeAs saved.
New locations are active and belong to the mode of your API key. If your account enforces purchase locations, issue and top-up requests must include a
store_id.Request
{
"title": "Lekki Phase 1 Kiosk",
"address": "14 Admiralty Way",
"latitude": 6.4474,
"longitude": 3.4723,
"country": "NG",
"state": "LA",
"city": "Lagos",
"postal_code": "106104"
}
Response 200
{
"ok": true,
"data": {
"id": "9f1c2e7a-4b22-4c10-9a3e-7d2f1b6c8a90",
"title": "Lekki Phase 1 Kiosk",
"latitude": "6.4474",
"longitude": "3.4723",
"address": "14 Admiralty Way",
"country": "NG",
"city": "Lagos",
"state": "LA",
"postal_code": "106104"
}
}
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
422
invalid_country_iso2
country must be a two-letter ISO code we know
422
invalid_state_iso2
state must be the ISO code of a state in that country
422
invalid_postal_code
postal_code is not in that country's format
429
rate_limited
Too many requests. Wait a moment and try again
500
internal_error
Something went wrong on our side. Try again; if it keeps happening, contact support
{
"ok": false,
"error": {
"code": "wrong_account_type",
"message": "Your account type cannot use this endpoint",
"fields": null
}
}
All error codes →