Your stores
List the redemption locations registered on your account, in the mode of your API key.
GET
https://afropin.com/api/v1/brand/stores
HMAC-signed request with a unique Idempotency-Key header. Authentication
With an SDK
PHP
$afropin->brand->stores->list($params)Node.js
afropin.brand.stores.list(params)Python
afropin.brand.stores.list(params)Java
afropin.brand().stores().list(params)Query parameters
page
integer | "all"
Optional
Page to return, starting at 1. Pass all to return every location without pagination; the response then has no paging.
limit
integer
Optional
Locations per page. Defaults to 20. Ignored when page=all.
Disabled locations are listed too, and the response does not show which ones are disabled. Paginated responses carry a
paging object with page, pages, per_page, total, next and previous.Location object
id
uuid
Required
Location ID. Send it as store_id when redeeming.
title
string
Required
Store name, saved with each word capitalised.
latitude
string
Required
Latitude, as a decimal string.
longitude
string
Required
Longitude, as a decimal string.
address
string
Required
Street address.
country
string
Required
ISO 3166-1 alpha-2 country code.
city
string
Required
City.
state
string
Required
State ISO2 code within the country.
postal_code
string
Required
Postal or ZIP code.
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"
}
],
"paging": {
"page": 1,
"pages": 1,
"per_page": 20,
"total": 1,
"next": null,
"previous": null
}
}
Errors
Failed requests return a stable code with a translated message. Branch on code, never on the message.
{
"ok": false,
"error": {
"code": "invalid_api_key",
"message": "This API key is unknown, revoked or expired, or live access is not switched on",
"fields": null
}
}
All error codes →