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
destinationin the quote to getshippingOptions. 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
shippingMethodset, a country outside the markets answers400 invalid_countryonshipping.country, and a method that does not serve the destination answers400 SHIPPING_UNAVAILABLE. PT-ISL(Portugal islands: Azores and Madeira, postal codes starting with9) is a market, never an address country. Keepcountry: "PT"in addresses and destinations, and always senddestination.postalCodefor 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
- Quote with
destination. - Show
shippingOptions(name, price,estimatedDayswhen notnull). - Quote again with the chosen
{ providerId, serviceId }asshippingMethod. - Read
selectedShippingand the newtotals. Shipping promotions apply only now.
Pickup Options
Two kinds of options need a pickup point. Both carryrequiresPickupPoint: true:
- Store pickup (
providerId: "store-pickup",serviceId: "STORE"). The option itself carriespickupPoints: 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 nopickupPoints: search them withGET /shipping/pickup-points.
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
idof a point from the search. Strapi confirms it by searching again withpickupPostalCode(the postal code the customer searched with) or, when absent, the shipping address postal code. SendpickupPostalCodewhenever the customer searched with a code other than their own. - Store pickup: the
idof one of the option’spickupPoints.pickupPostalCodeis ignored.
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.