Ankorstore Shipping API
ℹ️ Here your can find endpoints related to different types of shipping, available on the platform. Please note, that shipping information described here is only available for _Internal Orders_. For more details check the [Orders](#tag/Ordering/General-conceptions) section. ## 💡 How to ship an Internal Order? For shipping an internal order, Ankorstore provides two methods: - `Ankorstore Label` method : For this method, the shipping will be handled by Ankorstore carrier partners. The cost of shipping will be charged to the brand. - `Brand Label` method : For this method, the shipping will be handled by the brand itself and Ankorstore will provide a refund. To retrieve the shipping quotes, the brand must call the following endpoint: - Get quote list : `/v1/orders/:orderId/shipping-quotes` In the list of quotes, the `Ankorstore Label` method can be found by the carrier name `ankorstore` : ```json { "data": [ { "quoteUuid": "1efcd179-5753-6ee0-91a4-72a6c4e49e6a", "carrierCode": "ankorstore", "serviceCode": "", "serviceCommercialName": "", "collectionMethod": [], "shippingCost": { // Amount refunded to the brand if the quote is selected "amount": 1006, "currency": "EUR" }, "timeInTransit": null } ] } ``` Other methods have a different `carrierCode`: ```json { "data": [ { "quoteUuid": "1edd47df-b91a-68b0-b517-52e73cd28d4f", "carrierCode": "ups", "serviceCode": "11", "serviceCommercialName": "UPS Standard", "collectionMethod": [ "pickup", "drop-off" ], "shippingCost": { // Amount subtracted from total amount if the quote is selected "amount": 807, "currency": "EUR" }, "timeInTransit": { "estimatedDeliveryDate": "2025-01-10", "pickupDate": "2025-01-08", "businessDaysInTransit": 2 } } ] } ``` Once the quote is generated, the brand must confirm the selected one by calling : - Confirm shipping : `/v1/shipping-quotes/:quoteId/confirm` To find out more about Ankorstore's shipping options, please [visit our FAQs.](https://ankorstoresas.my.site.com/faq/s/article/what-shipping-options-are-available-with-ankorstore?language=en_US) The brand can list many quotes before they decide to **confirm** the quote. An example flow: flowchart LR A[Start] --> B[Get shipping quote list: orders/:orderId/shipping-quotes] B --> B.1{ankorstore carrier quote selected ?} B.1 -- NO --> B.YES[The brand will get the quote amount as a refund for the shipping] B.1 -- YES --> B.NO[The brand will be charged for the shipping by the quote amount] B.YES --> D[I Confirm the quote: shipping-quotes/:quoteId/confirm] B.NO --> D #### Parcels On either shipping method, if the brand has previously generated a quote and is now generating a new one the full list of parcels must be provided. The quote endpoint **cannot** be called with an empty parcel list to re-use the old parcel data. #### Confirming a quote To confirm a quote, the ID must be provided when calling the `/v1/shipping-quotes/:quoteId/confirm` endpoint. All information regarding shipping and tracking is stored within the `shippingOverview` object. This includes the `latestQuote` generated and the `shippingCostsOverview`. ## 💡 Shipping Costs In the endpoint for listing quotes `v1/orders/:orderId/shipping-quotes`, the shipping cost of the selected quote will be the **fee** subtracted from total amount for carriers (`ups`, `dhl_express`, etc) and a **refund** amount for `ankorstore` carrier (amount refunded to the brand): ```json { "data": [ { "quoteUuid": "1edd47df-b91a-68b0-b517-52e73cd28d4f", "carrierCode": "ups", "serviceCode": "11", "serviceCommercialName": "UPS Standard", "collectionMethod": [ "pickup", "drop-off" ], "shippingCost": { // Amount subtracted from total amount if the quote is selected "amount": 807, "currency": "EUR" } }, { "quoteUuid": "1efcd179-5753-6ee0-91a4-72a6c4e49e6a", "carrierCode": "ankorstore", "serviceCode": "", "serviceCommercialName": "", "collectionMethod": [], "shippingCost": { // Amount refunded to the brand if the quote is selected "amount": 1006, "currency": "EUR" } } ] } ``` #### Want more information about shipping contribution? To find out more about Ankorstore's contribution to your shipping costs, please [visit our FAQs.](https://knowledgecommunity.force.com/faq/s/article/shippingpolicy?language=en_US) ### Shipping with Brand Label The quote action will return an amount that will be refunded back to the brand based on the shipping grid refund matrix. The confirm action is synchronous, meaning when the action is called the order resource will have its status changed to `shipped` upon returning a response. It is up to brand to provide tracking details for the retailer when calling this action. sequenceDiagram participant O as Order participant SWC as Ship : orders/:orderId/shipping-quotes participant SC as Confirm : shipping-quotes/:quoteId/confirm participant SH as Shipped O->>SWC: List quotes SWC-->>O: Quote OK O->>SC: Confirm 'ankorstore' carrier quote SC->>SH: Status SC-->>O: OK In the `orders/:orderId/shipping-quotes` endpoint response, the quote uuid generated is the following: ```json { "quoteUuid": "1efcd179-56c1-6432-98e7-72a6c4e49e6a", "carrierCode": "ankorstore", ... } } ``` ### Shipping with Ankorstore Label (carrier name like ups, dhl_express, etc) When calling the `confirm` action for the order's Ankorstore shipping quote, the returned order resource's status will still be `brand_confirmed`. A job in the background will generate the shipping labels for the order. It is this background processing that moves the status to `shipping_labels_generated`. #### How will I know when the labels have been generated? Right now, the order must be polled periodically. Checking every minute would be suitable to detect the status change and then pull the label PDF data within the shippingOverview of an order resource. sequenceDiagram participant O as Order participant SWA as Ship with Ankorstore Label : orders/:orderId/shipping-quotes participant SC as Confirm shipping : shipping-quotes/:quoteId/confirm participant BG as Async Processing participant C as Carrier participant SH as Shipped O->>SWA: Get shipping quote list SWA-->>O: I accept one quote O->>SC: I confirm the quote SC-->>O: OK status=brand_confirmed SC-->>BG: Dispatch generate labels job Note over SC,BG: Async worker job BG-->>O: Labels generated, status=shipping_labels_generated Note over BG,O: (Async worker) C-->>SH: Parcels scanned, status=shipped Note over C,SH: (External service) At step 6 (shipping labels generated) the download URL's for each packages label will be available within the shippingOverview of an order resource. These labels are in PDF format and will also be visible in order details page on Ankorstore. In the `orders/:orderId/shipping-quotes` endpoint response, the quote uuid generated is the following: ```json { "quoteUuid": "1efcd179-56c1-6432-98e7-72a6c4e49e6a", "carrierCode": "ups", ... } } ``` ### Schedule a Pickup If the brand is not taking the parcels to the local drop-off point for the carrier the brand can schedule a pickup for this order. A pickup can only be scheduled on a working day (monday to friday). For full information please refer to the API documentation. #### Pickup is not accepted For now, Ankorstore does not know in advance which date/time configuration is available, if the requested pickup is denied please try a different date or time frame. ## ⚠️ Deprecation notice Some of the endpoints and documents from this section are deprecated and will be removed in the future. You can temporarily still find them [here](#tag/Deprecated).