Updating Shipping details for digital orders using API

vijaykrpp
Contributor
Contributor

I am using paypal Standard checkout using Rest API for digital orders. As soon as the client pay, the order is marked as COMPLETED. Now, I have to update the shipping details by going to txn page => Add Tracking info => Select order status => Order processed (Tracking no. not required) => submit.

vijaykrpp_0-1707648184987.png

 

I tried to do this using API by first getting the orderID from https://api.paypal.com/v2/payments/captures/{payment ID} and then getting the order details from https://api.paypal.com/v2/checkout/orders/{order_id};

 

But couldn't understand how do I update this status and which endpoint will work? Updating a number of orders manually is very tedious.

 

Login to Me Too
2 REPLIES 2

Kavyar
Moderator
Moderator

Good day @vijaykrpp 

 

Thank you for posting to the PayPal community.

 

To update the order status and shipping details using the PayPal REST API, you can utilize the Orders API. By using the "get" Order API, you can fetch the order details. To do so, please use the following link:

 

https://developer.paypal.com/docs/api/orders/v2/#orders_get

 

To update the order status and "shipping address" details, kindly refer to the link provided below:

 

https://developer.paypal.com/docs/api/orders/v2/#orders_patch

 

Merchant should first perform Create Order API( https://developer.paypal.com/docs/api/orders/v2/#orders_create) call and then redirect the customer/buyer to "approve" URL. 

 

Once the order is approved by the customer/buyer, merchant should perform CaptureOrder ( https://developer.paypal.com/docs/api/orders/v2/#orders_capture) API call and customer/buyer should pass the valid funding source. This will change the order status to "Completed".

 

If you are still experiencing issues, please create an MTS ticket via the following URL  - https://www.paypal-support.com/s/?language=en_US  .Please ensure that you provide detailed information and error details when submitting the ticket.

 

Sincerely,

Kavya

PayPal MTS

 

If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

Login to Me Too

vijaykrpp
Contributor
Contributor

Hi,

 

The order status is already COMPLETED status. Now, I have to add the shipping status. The /v2/checkout/orders/{id} endpoint => You cannot update an order with the COMPLETED status.

 

I am using Javascript SDK to create  buttons for the checkout.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.