Skip to main content

Markets and Destinations

The store sells only to its markets (Settings → General). A manual shipping method has weight brackets per market. A carrier such as CTT or DPD gets its price from the carrier API. Strapi offers a method only when the cart weight (each variant’s weight times its quantity) fits its brackets for the destination.
  • Send a destination in the quote to get shippingOptions. Ask for the country first, and for the postal code too when you can: some markets depend on it.
  • A country outside the markets, or one no method serves, returns shippingOptions: []. That is not an error: tell the customer the store does not ship there.
  • With a shippingMethod set, a country outside the markets answers 400 invalid_country on shipping.country, and a method that does not serve the destination answers 400 SHIPPING_UNAVAILABLE.
  • PT-ISL (Portugal islands: Azores and Madeira, postal codes starting with 9) is a market, never an address country. Keep country: "PT" in addresses and destinations, and always send destination.postalCode for Portugal so Strapi finds the right market and price.
  • A carrier that fails or times out simply leaves its options out of the list.
The API has no endpoint that lists the markets. Keep the list of countries your checkout offers in your frontend configuration, in line with the markets set in the admin, and rely on shippingOptions: [] for the rest.

Choose a Shipping Method

  1. Quote with destination.
  2. Show shippingOptions (name, price, estimatedDays when not null).
  3. Quote again with the chosen { providerId, serviceId } as shippingMethod.
  4. Read selectedShipping and the new totals. Shipping promotions apply only now.
Every listed price is the price the order is charged, because Strapi prices the options on this exact cart (gifts included).

Pickup Options

Two kinds of options need a pickup point. Both carry requiresPickupPoint: true:
  • Store pickup (providerId: "store-pickup", serviceId: "STORE"). The option itself carries pickupPoints: the store’s shops for the customer’s market (up to 100, no opening hours). Let the customer choose one.
  • DPD Pickup (providerId: "dpd-portugal", serviceId: "PICKUP"). The option has no pickupPoints: search them with GET /shipping/pickup-points.
The rule for your UI: if the option has pickupPoints, show that list. Otherwise, search the DPD points.

Search DPD Pickup Points

GET /shipping/pickup-points?postalCode=1000-001&country=PT Session: any guest or login session (in guest only mode, a guest session). Rate limit: cart.quote.
Response 200
day runs from 1 to 7 (DPD’s day number) and a day can have several intervals. No point near the code returns points: []. Strapi caches answers in memory per postal code for 10 minutes.

Pickup at Checkout

With a pickup method, POST /orders needs pickupPointId:
  • DPD Pickup: the id of a point from the search. Strapi confirms it by searching again with pickupPostalCode (the postal code the customer searched with) or, when absent, the shipping address postal code. Send pickupPostalCode whenever the customer searched with a code other than their own.
  • Store pickup: the id of one of the option’s pickupPoints. pickupPostalCode is ignored.
The order then ships to the point, with the customer’s name and phone from shippingAddress. The shipping price is the price of the point’s market, so quote with the point’s postal code as destination before you place the order, or the totals may not match.