Skip to main content

How to Use AfriRegions

Every setting explained, from installation to the mobile API, in the order you should configure them.

Installation

PrerequisitesWordPress 5.8+ · WooCommerce 6.0+ · PHP 7.4+

  1. 1.Upload the plugin folder to /wp-content/plugins/, or install it from WordPress.org
  2. 2.Activate it from the WordPress Plugins menu
  3. 3.Go to WooCommerce → Settings → General and add the African countries you sell and ship to
  4. 4.Open WooCommerce → AfriRegions to reach the dashboard and start setting up

Step Zero: Choose Your Countries

AfriRegions only activates for the countries you actually sell to, and WooCommerce owns that list. Set it before anything else.

  1. 1.Go to WooCommerce → Settings → General
  2. 2.Add your African countries to Selling location(s) and Shipping location(s)
  3. 3.If you only sell in Cameroon, add only Cameroon, the plugin then loads Cameroon data only
Good to know

The plugin ships with 24 countries but only enables the ones you allowed here. A rule configured for a country missing from this list will never load, so add the country first, then come back and configure your rules.

Selling location(s)
🇨🇲Cameroon×🇨🇮Cote d'Ivoire×🇸🇳Senegal×
Shipping location(s)
Ship to specific countries only

The Zones Tab

WooCommerce → AfriRegions → Zones shows the tree of your geographic data: for each country its regions, for each region its cities, for each city its neighborhoods. Use it to check what exists and complete what is missing.

  1. 1.Browse: expand a region to see its cities, expand a city to see its neighborhoods
  2. 2.Search: the bar at the top filters the list as you type
  3. 3.Filter by country: a selector lets you show one country at a time
  4. 4.Add a city: expand a region, click “Add a city”, type the name
  5. 5.Add a neighborhood: inside a city, click “Add” and type the name
  6. 6.Delete: anything you added can be removed, and places shipped with the plugin can be hidden if you don't use them
Good to know

A badge tells you whether a place is origin (shipped with the plugin) or custom (added by you).

Littoral
Douala
DeidoOrigin
Akwa NordCustom

The Checkout Tab

WooCommerce → AfriRegions → Checkout lets you reshape the form your customer fills in at payment: field order, labels, which ones are visible, which ones are required.

  1. 1.Turn on the master switch “Enable order field customization”, it is off by default and WooCommerce keeps its usual fields until you enable it
  2. 2.Pick a sub-tab, Billing and Shipping are configured separately and independently
  3. 3.Reorder: grab the handle on the left of a row and drag it
  4. 4.Rename: type a name in the “Custom label” column, leave it empty to keep the default
  5. 5.Toggle the “Required” and “Visible” checkboxes, a hidden field is never asked for
  6. 6.Save your settings, or reset the active section back to the WooCommerce defaults
Good to know

The Layout column shows whether a field renders full width or half width (two fields side by side, like First name + Last name when both are visible). It is automatic. The AfriRegions City, Region and Neighborhood fields are grouped separately, they are always present at checkout and cannot be hidden, but you can relabel them, for example “District” instead of “Neighborhood”.

BillingShipping
Custom labelRequiredVisible
City
Region
Neighborhood

Shipping Rates by Zone

Rates are not set in the AfriRegions menu but where WooCommerce handles shipping. Add the “AfriRegions - Region / City / Neighborhood rates” method to a shipping zone, then build your rules.

  1. 1.Go to WooCommerce → Shipping, pick or create a shipping zone, then Add shipping method
  2. 2.Choose “AfriRegions - Region / City / Neighborhood rates”
  3. 3.Set the Title shown to the customer, keep it neutral like “Home delivery”, avoid putting “AfriRegions” in it
  4. 4.Set the Default price, the rate used when none of your rules matches the destination
  5. 5.Optionally tick “Hide if no rule matches”, the method then disappears instead of showing the default price, which makes the default price irrelevant
  6. 6.Optionally set “Free shipping from” (Pro), leave it empty to disable, 0 disables the threshold rather than making everything free
  7. 7.Add your rules: a region (required), optionally a city, optionally one or more neighborhoods, a price, and optionally a per-rule free shipping threshold (Pro)
  8. 8.In Pro, add delivery tiers (Express, Same Day) with their surcharge and estimated time, and use CSV export/import for bulk editing
Good to know

The most precise rule wins: a neighborhood rate beats a city rate, which beats a region rate, which beats the default price. Tax status and tax class default to Not taxable, change them only if you charge VAT on shipping. Remember that a WooCommerce shipping zone must cover the country your rules target, otherwise they never fire.

DeidoNeighborhood1,000 CFA
DoualaCity1,500 CFA
LittoralRegion2,000 CFA
Default2,500 CFA

Pickup Points

Pro

Let customers collect their order instead of having it delivered. Fewer failed home deliveries, fewer returns.

  1. 1.Go to WooCommerce → Shipping → your zone → Add shipping method
  2. 2.Choose “AfriRegions - Pickup Point”
  3. 3.Set the Title shown to the customer
  4. 4.Add your pickup points: name, location (region, city, neighborhood), address, opening hours and phone
  5. 5.At checkout, customers only see the points in their city or region and pick the most convenient one
Good to know

Collection is free. The chosen point then appears on the order confirmation, in the customer email and in their account, so they always know where to collect their parcel.

AfriRelais Akwa
Rue Joss, Akwa · Douala
8:00 – 18:00 · +237 6 71 23 45 67
0 CFA
Point Bonanjo
Blvd de la Liberté · Douala
0 CFA

Travel Agency Shipping

Pro

Intercity delivery through bus companies and travel agencies, the way parcels commonly travel in Cameroon, Cote d'Ivoire and Senegal. You price the route, the customer collects at the destination agency.

  1. 1.Go to WooCommerce → Shipping → your zone → Add shipping method
  2. 2.Choose “AfriRegions - Travel Agency”
  3. 3.Set the Title shown to the customer, the tax status and the default price
  4. 4.Add your routes: one price per destination, city or region
  5. 5.Add your agencies, the collection points at destination
  6. 6.At checkout the price comes from the route, and the customer selects the agency that suits them
Good to know

Priority is city, then region, then the default price. A route is only offered at checkout if at least one agency serves it, and the editor warns you when you create a route with no agency in its area. The chosen agency appears on the order confirmation, in the email and in the customer account.

DoualaYaoundé3,000 CFA
Général Express Voyages
Central Voyages

Address Verification

The plugin checks that what the customer selected is consistent: that the city really belongs to the region, and the neighborhood to the city. An inconsistent address is flagged before the order is validated, with a clear, non-technical message.

City
Douala
NeighborhoodDeido

The Developer Tab

Pro

WooCommerce → AfriRegions → Developer groups the two settings meant for advanced integrations. Both are off by default, and both need you to click Save.

  1. 1.Enable REST API: exposes your address data (countries, regions, cities, neighborhoods) so a mobile app or another system can read it. Once on, the screen shows the API base URL and the list of routes
  2. 2.Enable international phone field: turns the checkout phone field into one with a country flag and automatic dial code. The flag follows the billing country and the number is stored in international format (+237…)
  3. 3.Click Save settings after changing either switch
Good to know

Turn the phone field on as soon as your couriers need to call your customers, which is to say almost always.

Enable REST API
Expose geographic data via the AfriRegions REST API.
Enable international phone field
Country flag, dial code, and E.164 storage at checkout.
https://your-store.com/wp-json/scpwoo/v1/

REST API: Address Data

Pro

All routes are public, read-only (GET) and return JSON. No authentication is needed since geographic data is public. Data is filtered to the countries your store sells and ships to, and a 120 requests per minute rate limit protects the server, beyond which you get a 429 with a Retry-After header.

RouteWhat it returns
GET /snapshotThe whole dataset in a single call, the recommended method for offline-first apps.
GET /versionA data version token, so you know when to re-sync.
GET /countriesSupported countries, with their region and city counts.
GET /regionsAll regions (paginated: page, per_page).
GET /regions/{code}One region (2-letter code) and its cities.
GET /citiesAll cities. Filter with ?region={code}.
GET /cities/{name}One city and its neighborhoods.
GET /neighborhoodsAll neighborhoods. Filter with ?city={name}.
GET /neighborhoods/{city}The neighborhoods of one city.
GET /search?q=Accent-insensitive search across every level (per_page).
# The version token (a few bytes)
curl https://your-store.com/wp-json/scpwoo/v1/version
# → {"version":"2.1.0.1784842422","generated_at":"2026-07-23T22:07:11+00:00"}

# Supported countries
curl https://your-store.com/wp-json/scpwoo/v1/countries
# → [{"code":"CM","name":"Cameroon","region_count":10,"city_count":152}]

# Everything, in one call
curl https://your-store.com/wp-json/scpwoo/v1/snapshot
Good to know

Offline-first is the recommended pattern: call /snapshot once on first launch and store it on the device, then read everything locally so the country → region → city → neighborhood picker is instant and works offline. Re-check from time to time with /version, or better, with the standard ETag / If-None-Match headers, which return 304 Not Modified with no body when nothing changed.

GET /wp-json/scpwoo/v1/snapshot
{
  "version": "2.1.0.1784842422",
  "countries": [{ "code": "CM", … }]
}
200 OK304 Not ModifiedETag · 120 req/min

Store API: Real Shipping Rates

Pro

The AfriRegions API does not compute shipping prices, that is not its job. Real prices come from the native WooCommerce Store API at /wp-json/wc/store/v1/, which automatically includes your AfriRegions methods. Build a cart, put an address on it, and WooCommerce returns the available methods and their computed prices. AfriRegions fills the address, WooCommerce computes the shipping, your app displays both.

  1. 1.GET /wc/store/v1/cart to get a cart, note the Cart-Token and Nonce response headers and send them back on every following call
  2. 2.POST /wc/store/v1/cart/add-item with {"id": 18172, "quantity": 1} to add a product
  3. 3.POST /wc/store/v1/cart/update-customer with the shipping address, including the neighborhood under the scpwoo/neighborhood key
  4. 4.Read the shipping_rates array in the response, each entry lists the available methods and their price
  5. 5.POST /cart/select-shipping-rate for the customer's choice, then continue with the standard POST /checkout flow
curl -X POST https://your-store.com/wp-json/wc/store/v1/cart/update-customer \
  -H "Content-Type: application/json" \
  -H "Cart-Token: <token>" \
  -H "Nonce: <nonce>" \
  -d '{
        "shipping_address": {
          "country": "CM",
          "state": "LT",
          "city": "Douala",
          "address_1": "Rue 123",
          "scpwoo/neighborhood": "Bonapriso"
        }
      }'
Good to know

The Store API natively knows country, state and city, but not the neighborhood, which is specific to AfriRegions. Send it under scpwoo/neighborhood and your app gets the neighborhood rate, exactly like the website checkout. Without it you only get city and region rates. This bridge needs WooCommerce 8.9 or newer. Never reimplement pricing in the app: the server computes, the app displays, and any rule you change in the admin applies instantly to both your website and your app.

shipping_rates
Livraison à domicilescpwoo_zone_shipping:156,000
Retrait en magasinscpwoo_pickup:170
"scpwoo/neighborhood": "Bonapriso"