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 → Settings → AfriRegions for your checkout fields and places, and WooCommerce → Settings → Shipping for your prices

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 24 countries but only turns on the ones you allow here. A price set for a country missing from this list will never apply: add the country first, then come back to set your prices.

Selling location(s)
🇿🇦South Africa×🇨🇮Cote d'Ivoire×🇸🇳Senegal×
Shipping location(s)
Ship to specific countries only

The Regions and cities section

WooCommerce → Settings → AfriRegions → Regions and cities shows the tree of your geographic data: the regions of each country, the cities of each region, the neighborhoods of each city. Use it to check what exists and fill in 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).

The Checkout fields section

WooCommerce → Settings → AfriRegions → Checkout fields lets you reshape the form your customer fills in at checkout: the order of the fields, their labels, which ones are visible and 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”.

Shipping prices by zone

Prices are not set in the AfriRegions settings but where WooCommerce manages shipping. Add the "AfriRegions - Region / City / Neighborhood Rates" method to a shipping zone: its screen is a table, one line per destination, one column per price.

  1. 1.Go to WooCommerce → Settings → Shipping, pick or create a shipping zone, then Add shipping method
  2. 2.Choose "AfriRegions - Region / City / Neighborhood Rates"
  3. 3.Click "+ Add destinations": the list of the zone's regions opens. Expand a region to see its cities, a city to see its neighborhoods, tick as many places as you want, give them a price, then "Add"
  4. 4.Neighborhoods of one city ticked together share a single line; "Split" gives each of them its own price
  5. 5.Click a price to change it, a destination to pick another one (it keeps its prices), or tick several lines to apply a price to them or delete them in one go
  6. 6.Set the "Everywhere else" line: the price of destinations without their own line, or "Do not deliver" to hide the method there
  7. 7.In the general settings, under the table, set the title shown to customers (keep it neutral, like "Home delivery") and, if needed, taxes
  8. 8.In Pro: the "Free shipping from" column (empty = no free shipping, 0 turns the threshold off), Express and Same Day options, price by weight, surcharges for bulky products and CSV import / export
Good to know

The most precise price wins: a neighborhood price beats a city price, which beats a region price, which beats "Everywhere else". The tax status is "None" by default; only change it if you charge VAT on shipping. A WooCommerce shipping zone must cover the country of your destinations: the screen flags lines outside the zone, which would never apply.

Price by weight and bulky products

Pro

Two ways to charge more for what costs more to deliver, in the "AfriRegions - Region / City / Neighborhood Rates" method.

  1. 1.Price by weight: tick "Price by weight" in the general settings. Two columns appear: "Weight included" (the weight included in the price) and "Per extra kg" (the price of each kilo started beyond it)
  2. 2.Example: Dakar 1,500, 5 kg included, 500 per extra kg; a 7.2 kg parcel costs 1,500 + 3 × 500 = 3,000. Products without a weight count for 0
  3. 3.Bulky products: create a shipping class in WooCommerce → Settings → Shipping → Classes ("Large TV", "Appliances"…), then choose it in the Shipping tab of the products concerned, or for many products at once with Bulk edit
  4. 4.Under the prices table, the "Product surcharges" section gives one line per class: enter its surcharge, added to the price of the destination
  5. 5.Choose the calculation: "Per item" (two TVs, two surcharges), "Per class" (once for each class in the cart) or "Highest only" (only the largest surcharge)
  6. 6.For pickup points and agencies, "Not available for" in their general settings hides the method when the cart holds one of these classes
Good to know

The surcharge and the weight extra are still due when delivery is free: the threshold cancels the price of the destination, not the cost of carrying a large parcel. A class surcharge applies to the whole method, so to the whole zone: if a large product costs much more to deliver to some cities, give them their own zone.

Pickup points

Pro

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

  1. 1.Go to WooCommerce → Settings → Shipping → your zone → Add shipping method
  2. 2.Choose "AfriRegions - Pickup Point"
  3. 3.Type the name of a new point in the last line of the table, then pick its place (region, city or neighborhood) from the zone's list
  4. 4.Fill in its address, phone and opening hours; the "Active" switch takes it off the checkout without deleting it
  5. 5.In the general settings, "Not available for" hides the method when the cart holds a product too large for a pickup point
  6. 6.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.

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 → Settings → Shipping → your zone → Add shipping method
  2. 2.Choose "AfriRegions - Travel Agency"
  3. 3.In the "Routes" table, click "+ Add routes", tick the regions or cities you serve and give them a price; "Everywhere else" sets the price of the other destinations
  4. 4.In the "Agencies" table, add the collection points at the destination, picked from the zone's list of places
  5. 5.In the general settings: displayed title, taxes, and "Not available for" for products too bulky for the bus
  6. 6.At checkout, the price comes from the route and customers pick the agency that suits them
Good to know

Priority: city, then region, then "Everywhere else". A route only shows at checkout if at least one agency serves it: the screen flags it in the "To check" view. The chosen agency appears on the order confirmation, in the email and in the customer's account.

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.

The Developer section

Pro

WooCommerce → Settings → AfriRegions → Developer holds the two settings meant for advanced integrations. Both are off by default, and both need a click on 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.

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 price 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"