AfroPin Developers
Postman Sign in Get test keys

Edit a store

Replace the details of a purchase location, or switch it off. Send every field, not only the ones that change.

POST https://afropin.com/api/v1/reseller/stores/{store_id}

HMAC-signed request with a unique Idempotency-Key header. Authentication

With an SDK
PHP$afropin->reseller->stores->update($storeId, $params)
Node.jsafropin.reseller.stores.update(storeId, params)
Pythonafropin.reseller.stores.update(store_id, params)
Javaafropin.reseller().stores().update(storeId, params)

Path parameters

retail uuid Required

The location id. It must belong to your account and to the mode of your API key.

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.

status boolean Required

true to keep the location active, false to switch it off. An inactive location is rejected as store_id with invalid_store_id.

Response fields

id
Location ID. Send it as store_id when you issue or top up a PIN.
latitude, longitude
Returned as strings.
title, address, country, state, city, postal_code
As saved.

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",
    "status": true
}

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.

403 wrong_account_type Your account type cannot use this endpoint
404 purchase_location_not_found No store of yours has this id
422 validation_error Some fields are missing or invalid
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": "purchase_location_not_found",
        "message": "No store of yours has this id",
        "fields": null
    }
}
All error codes →