AfroPin Developers
Postman Sign in Get test keys

Stores

Edit a store

Replace the details of one of your redemption locations, or disable it.

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

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

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

Path parameters

retail uuid Required

The location id. It must be one of your redemption locations in the mode of your API key.

Body parameters

title string Required max 255

Store name.

address string Required max 255

Street address.

latitude numeric Required -90 to 90

Latitude in decimal degrees.

longitude numeric Required -180 to 180

Longitude in decimal degrees.

city string Required max 255

City.

state string Required

ISO2 code of a state in country, for example LA for Lagos. Any other value fails with invalid_state_iso2.

postal_code string Required max 255

Postal or ZIP code, checked against the format used in country.

country string Required 2 chars

ISO 3166-1 alpha-2 country code, in capitals, for example NG.

status boolean Required

true keeps the location active, false disables it.

Every field is required: send the full location, not only what changed. The response does not include status.

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.

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

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.

403 wrong_account_type Your account type cannot use this endpoint
404 redemption_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": "redemption_location_not_found",
        "message": "No store of yours has this id",
        "fields": null
    }
}
All error codes →