Update order details
Last updated: Sept 26th, 5:17pm
For increased flexibility when obtaining payments from buyers, you can update an existing order. Updating orders allows you to:
- Determine additional amounts, including shipping and tax.
- Capture a different total amount without the payer re-approving the order.
- Update fields, such as shipping address, after collecting them from the payer.
Know before you code
Get Started
Complete the steps in Get started to get the following sandbox account information from the Developer Dashboard:
- Your personal and business sandbox accounts.
- Your access token.
Standard or Advanced Checkout
This feature modifies an existing standard Checkout or advanced Checkout integration and uses the following:
- JavaScript SDK: Adds PayPal-supported payment methods.
- Orders REST API: Create order and Update order
Explore PayPal APIs with Postman
You can use Postman to explore and test PayPal APIs. Learn more in our Postman guide.
Update order details
Before you capture the money from the order, call the Orders API on your server with the order ID. You can pass in a different amount
, invoice_id
, and custom_id
. See the following code sample:
1curl -v -X PATCH 'https://api-m.sandbox.paypal.com/v2/checkout/orders/5O190127TN364715T' \2 -H 'Authorization: Bearer ACCESS-TOKEN' \3 -H 'Content-Type: application/json' \4 -d '[5 {6 "op": "add",7 "path": "/purchase_units/@reference_id=='PUHF'/invoice_id",8 "value": {9 "integration_artifact": "INV-HighFashions"10 }11 }12]'