Download PDF
Download page Updating Order Details.
Updating Order Details
A customer has created an order through a quote using CPQ APIs. By default, the status of the order is 'Created'. Later, for any reason, the customer decided to update the order. Sales or customer representatives can update an order based on new requirements from the customer. Once the order is created, you can only edit or update the order header details (except the order status).
You cannot update header fields after confirming the order.
The Update an order API allows you to modify the following header fields:
- Account
- Bill To
- Ship To
- Primary Contact
To update the order successfully, you must invoke the order APIs in the following order.
You can directly run this API If you know the order id for which the header details are to be updated.
Prerequisite:
You must gather the following to update the order.
- Order ID
- Order Name
You can use the GET/orders
API to retrieve all orders in the system. For more information, see Order APIs.
Example 1
The following table lists the API method, endpoints, and sample codes for fetching order details.
Method | GET |
---|---|
Endpoint | /orders |
Request URL | https://<URL_of_the_Instance>/api/order/v1/orders/ |
Request | The following sample code fetches the order.
CODE
|
Response | This API returns the structure of the order details of the order id passed in the request body. Response Body:
CODE
|
Example 2
The following table lists the API method, endpoints, and sample codes for request and response, to update the order.
Method | PATCH |
---|---|
Endpoint | /orders |
Request URL | https://<URL_of_the_Instance>/api/order/v1/orders/id |
Request | The following sample code updates the description and shipTo account in the order 3.
CODE
|
Response | This API returns the structure of the order details, which includes the updated primary contact based on the request body. Response Body:
CODE
|
Example 3
The following table lists the API method, endpoints, and sample codes for request and response, to update the order description and ShipTo details for an order 3.
Method | PATCH |
---|---|
Endpoint | /orders |
Request URL | https://<URL_of_the_Instance>/api/order/v1/orders/orderid |
Request | The following sample code updates the primary contact that is associated with order3.
CODE
|
Response | This API returns the structure of the order details, which includes the updated description and ShipTo details based on the request body. Response Body:
CODE
|