Reserve Shipping Option
Reserving a selected shipping option
Last updated 24 Jun 2024
The ReserveDeliveryChoice
endpoint should be called after the user has made their final choice, and before payment has gone through. Normally, this happens with the click of a button such as "Continue to payment".
Why reserve before payment?Calling
ReserveDeliveryChoice
is strongly recommended in cases where there may be a disconnect or loss of information between the selection of the shipping option and the payment.Such a loss of information can happen, for example, in cases where the payment happens on a separate page and the entered information from the previous step is reset.
This call ensures that the selected shipping option is linked to the order while all information is still available.
At this stage, we validate the selected shipping option and chosen addons to ensure a booking can be made.
The selected option is stored for either Skrym or your other systems to book the shipment after payment confirmation. This also enables us give you statistics about how many of your users finalize a delivery method, but don't go through with payment.
In this call, you should also provide the same sessionId
as you used in the Get Shipping Options API to ensure that the selection is connected to the correct session.
Calling ReserveDeliveryChoice
, provides your checkout with a basketId
that is is expected in the call to the Confirm Payment API.
After a successful reservation, the last step is to then confirm the payment using the Confirm Payment API.
Error Handling
Error handling in both approaches is crucial to ensure a smooth user experience. The recommended approach allows you to handle errors before payment, while the simplified approach requires you to handle errors after payment.