allegro / allegro-api

Issue tracker and wiki for Allegro REST API
https://developer.allegro.pl/
213 stars 39 forks source link

the order of api calls for ship with allegro #9606

Open yangcen6 opened 1 month ago

yangcen6 commented 1 month ago

If we use Ship with Allegro to ship from our own warehouse, what is the order of API calls?

  1. call /order/checkout-forms/{id} to obtain order information
  2. call /shipment-management/shipments/create-commands to get the command.Id
  3. request /shipment-management/shipments/create-commands/{commandId} to get the shipment.Id
  4. request /shipment-management/pickup-proposals to get the proposalitems.id
  5. call /shipment-management/shipments/{shipmentId} to get the tracking number
  6. call /shipment-management/pickups/create-commands to request the carrier to ship the package
  7. call /shipment-management/label to get the shipment label
  8. call /order/carriers/{carrierId}/tracking to get if the package has been delivered

Do we need to call so many endpoints to complete it? It would be better if you have a detailed flowchart.

Lukasz-Zurek commented 1 month ago

@yangcen6

If we use Ship with Allegro to ship from our own warehouse, what is the order of API calls?

  1. call /order/checkout-forms/{id} to obtain order information
  2. call /shipment-management/shipments/create-commands to get the command.Id
  3. request /shipment-management/shipments/create-commands/{commandId} to get the shipment.Id
  4. request /shipment-management/pickup-proposals to get the proposalitems.id
  5. call /shipment-management/shipments/{shipmentId} to get the tracking number
  6. call /shipment-management/pickups/create-commands to request the carrier to ship the package
  7. call /shipment-management/label to get the shipment label
  8. call /order/carriers/{carrierId}/tracking to get if the package has been delivered

Do we need to call so many endpoints to complete it? It would be better if you have a detailed flowchart.

Yes, but I would skip point no. 2 (or add retrieving delivery services in this place) and no. 6 (you have already done It in point no. 3 - it is one request for create a shipment).

Thank you for your suggestion regarding a detailed flowchart for this service. We can think about it. But for now we do have this guide. We have tried to present this process from the beginning to the end, step by step.

yangcen6 commented 1 month ago
  1. So when an order is generated, we can directly get the shipment.id through no.3? But how can we get the command,id, because command.id is the required to request /shipment-management/shipments/create-commands/{commandId}? 20240807-162735

  2. What is the difference from no.3 and no. 6?

Lukasz-Zurek commented 1 month ago

@yangcen6

  1. You can generate UUID for commandId on your side and pass it while creating a shipment via POST /shipment-management/shipments/create-commands but you do not have to provide commandId - if so, we will generate it automatically.

  2. Sorry, I have looked at this too fast. Using POST /shipment-management/pickups/create-commands you can order the pickup of shipments by the courier. You should not skip it. No. 3 is for creating a shipment and no. 6 is for ordering the pickup of shipments.

yangcen6 commented 1 month ago
  1. That is, I can directly transmit null for command.id ​​when calling /shipment-management/shipments/create-commands/{commandId} ?
  2. For every order, we have to create a shipment through no.3 ( /shipment-management/shipments/create-commands/{commandId} ) ?
Lukasz-Zurek commented 1 month ago
  1. No, you should just not provide this field (then we will generate it automatically).
  2. Yes.
yangcen6 commented 1 month ago

If we have already called no.3(/shipment-management/shipments/create-commands/{commandId} ), do we have to call no.4(/shipment-management/pickup-proposals to get the proposalitems.id) and no.6(/shipment-management/pickups/create-commands to request the carrier to ship the package)?

Lukasz-Zurek commented 1 month ago

@yangcen6 If you want to request a pickup by a courier - it will be needed.

yangcen6 commented 1 month ago

This is what I drew. It shows the order of endpoints we should call from order creation to delivery. Please help me check if it is correct.

流程图 (15)

Lukasz-Zurek commented 1 month ago

Yes, it is correct. We present this process step by step here.

yangcen6 commented 1 month ago

OK,thanks!

yangcen6 commented 3 weeks ago

for this /order/carriers/{carrierId}/tracking, where can we get the carrierId? 20240820-160435

Lukasz-Zurek commented 3 weeks ago

You can check the available values in the response to GET /shipment-management/delivery-services. We have already described it here.

yangcen6 commented 3 weeks ago
  1. If our warehouse has agreed with the carrier on the time to pick up the parcel every day, do we still need to call these two endpoints /shipment-management/pickup-proposals and /shipment-management/pickups/create-commands?
  2. What does the date returned in this field proposalItems.name represent? Is it the time we asked the carrier to pick up the shipment?
Lukasz-Zurek commented 3 weeks ago
  1. No, you do not have to use these resources in this specific situation.
  2. These are proposed dates of pickup of the parcel by the courier -you will find there some details about the shipment pickup time.
stale[bot] commented 1 week ago

W tym wątku nie pojawiła się żadna nowa odpowiedź w ciągu 7 dni, dlatego automatycznie oznaczamy go jako przeterminowany. Jeśli w ciągu kolejnych 7 dni nie pojawi się żadna odpowiedź, wątek zostanie zamknięty. Dziękujemy za zaangażowanie w dyskusję i zachęcamy Cię do wypełnienia ankiety dotyczącej naszego wsparcia na forum.


There was no new reply in this thread within 7 days, therefore, we automatically marked it as expired. If no response is received within the next 7 days, this thread will be closed. Thank you for engaging in the discussion. We encourage you to complete our forum support survey.