Stores
Add a store
Register a store where your customers can redeem PINs. Send its ID as store_id when redeeming so each payment is attributed to a store.
HMAC-signed request with a unique Idempotency-Key header. Authentication
$afropin->brand->stores->create($params)afropin.brand.stores.create(params)afropin.brand.stores.create(params)afropin.brand().stores().create(params)Body parameters
Store name.
Street address.
Latitude in decimal degrees.
Longitude in decimal degrees.
City.
ISO2 code of a state in country, for example LA for Lagos. Any other value fails with invalid_state_iso2.
Postal or ZIP code, checked against the format used in country.
ISO 3166-1 alpha-2 country code, in capitals, for example NG.
Location object
Location ID. Send it as store_id when redeeming.
Store name, saved with each word capitalised.
Latitude, as a decimal string.
Longitude, as a decimal string.
Street address.
ISO 3166-1 alpha-2 country code.
City.
State ISO2 code within the country.
Postal or ZIP code.
Request
{
"title": "Lekki Phase 1 Store",
"address": "12 Admiralty Way",
"latitude": 6.4474,
"longitude": 3.4723,
"city": "Lagos",
"state": "LA",
"postal_code": "106104",
"country": "NG"
}
Response 200
{
"ok": true,
"data": {
"id": "5c1e8f2a-7b3d-4e19-a6c0-2d9f4b8e1a73",
"title": "Lekki Phase 1 Store",
"latitude": "6.4474",
"longitude": "3.4723",
"address": "12 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.
validation_error
Some fields are missing or invalid
wrong_account_type
Your account type cannot use this endpoint
invalid_country_iso2
country must be a two-letter ISO code we know
invalid_state_iso2
state must be the ISO code of a state in that country
invalid_postal_code
postal_code is not in that country's format
rate_limited
Too many requests. Wait a moment and try again
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 →