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.

MethodGET
Endpoint/orders
Request URLhttps://<URL_of_the_Instance>/api/order/v1/orders/
Request

The following sample code fetches the order.

"https://rlp-dev.congacloud.io/api/order/v1/orders/<order id>"
CODE
Response

This API returns the structure of the order details of the order id passed in the request body.

Response Body:

{
  "ActivatedDate": null,
  "AmendmentEffectiveDate": null,
  "AutoActivateOrder": false,
  "BillingPreference": null,
  "BillToAccount": {
    "Id": "<id of the billing account>",
    "Name": "<name of the bill to account>"
  },
  "CancelledDate": null,
  "CompletedDate": null,
  "ConfigurationEffectiveDate": null,
  "ConfigurationSyncDate": null,
  "Description": "RLPOrder Description",
  "FulfilledDate": null,
  "LegalEntity": null,
  "Location": null,
  "NextVersion": null,
  "OrderAmount": null,
  "OrderDate": null,
  "OrderEndDate": null,
  "OrderReferenceNumber": null,
  "OrderStartDate": null,
  "OriginalOrderNumber": null,
  "ParentOrder": null,
  "PartnerAccount": null,
  "PaymentStatus": null,
  "PaymentTerm": null,
  "PODate": null,
  "PONumber": null,
  "PreviousVersion": null,
  "PriceList": {
    "Id": "e7244530-40fc-4926-a78a-fd4d2c6df962",
    "Name": "AutoQuoteRLP_QuotePL"
  },
  "PricingDate": null,
  "PrimaryContact": {
    "Id": "f2b5232a-deb3-4cd0-a49c-4ac2d50f1e08",
    "Name": "AutoQuoteRLP_PrimaryContact1"
  },
  "Proposal": {
    "Id": "4cf93b4b-5224-40f9-b0ac-7ca5b63118ce",
    "Name": "AutoQuoteService_Name-736431291667818708925_855"
  },
  "PurchaseId": null,
  "PurchaseOrder": null,
  "ReadyForBillingDate": null,
  "ReadyForRevRecDate": null,
  "ReadyForWorkflow": false,
  "RelatedOpportunity": null,
  "ShipToAccount": {
    "Id": "25c6d8a5-12c7-4970-ac96-87335ea888f1",
    "Name": "AutoQuoteShipToRLPAccount_"
  },
  "SingleTransactionAdjustment": false,
  "SoldToAccount": {
    "Id": "ae80f382-0356-48df-80cf-dd22b550ee81",
    "Name": "AutoQuoteSoldToRLPAccount_"
  },
  "Source": "Account",
  "SourceChannel": "Direct",
  "Status": "Generated",
  "Type": "New",
  "Currency": "USD",
  "Id": "ffea69f1-a4af-4467-afda-eb56185f9034",
  "Name": "RLPOrder Name-157736110",
  "CreatedBy": {
    "Id": "27634e3f-904a-4321-9ce5-c2edbe181d90",
    "Name": "Test User"
  },
  "CreatedDate": "2022-11-07T10:57:54",
  "ModifiedBy": {
    "Id": "11111111-1111-1111-1111-111111111111",
    "Name": "System Admin"
  },
  "ModifiedDate": "2022-11-21T13:59:37",
  "ExternalId": null,
  "QuoteAuto_Boolean_CstField_c": true,
  "QuoteAuto_PickList_CstField_c": "INR",
  "QuoteAuto_Int_CstField_c": 150,
  "QuoteAuto_Double_CstField_c": 77.89,
  "QuoteAuto_String_CstField_c": "Order_Service",
  "QuoteAuto_DateTime_CstField_c": "2020-07-18T00:00:00",
  "QuoteAuto_Multipicklist_CstField_c": [
    "Red",
    "Blue"
  ],
  "QuoteAuto_Currency_CstField_c": null
}
CODE

Example 2

The following table lists the API method, endpoints, and sample codes for request and response, to update the order.

MethodPATCH
Endpoint/orders
Request URLhttps://<URL_of_the_Instance>/api/order/v1/orders/id
Request

The following sample code updates the description and shipTo account in the order 3. 

{
     "AutoActivateOrder": false,
     "ReadyForWorkflow": false,
     "ShipToAccount": {
          "Id": "25c6d8a5-12c7-4970-ac96-87335ea888f1",
          "Name": "AutoQuoteShipToRLPAccount_"
     },
     "SingleTransactionAdjustment": false,
     "Source": "Account",
     "SourceChannel": "Direct",
     "Status": "Pending",
     "Type": "New",
     "Name": "Order3",
     "Description": "This is a sample order"
}
'    
CODE
Response

This API returns the structure of the order details, which includes the updated primary contact based on the request body.

Response Body:

{
  "Name": "Order3",
  "Id": "f35934bc-b04b-4fe8-990a-5676c7615f2a",
  "CreatedBy": {
    "Id": "ddfec712-8827-4684-8287-1373e4f1f43d",
    "Name": "Conga User"
  },
  "CreatedDate": "2022-07-18T16:23:07",
  "ModifiedBy": {
    "Id": "ddfec712-8827-4684-8287-1373e4f1f43d",
    "Name": "Conga User"
  },
  "ModifiedDate": "2022-07-21T09:03:36",
  "ExternalId": null,
  "ActivatedDate": "2022-07-18T16:23:07",
  "AmendmentEffectiveDate": null,
  "AutoActivateOrder": false,
  "BillingPreference": null,
  "BillToAccount": {
    "Id": "dcb42e39-15c2-4895-aa35-53ee6c140d78",
    "Name": "Conga"
  },
  "CancelledDate": null,
  "CompletedDate": null,
  "ConfigurationEffectiveDate": null,
  "ConfigurationSyncDate": null,
  "Description": "Test DC Order",
  "FulfilledDate": null,
  "LegalEntity": null,
  "Location": null,
  "NextVersion": null,
  "OrderAmount": {
    "Value": 100,
    "DisplayValue": 100,
    "CurrencyCode": "USD",
    "CurrencySymbol": "$"
  },
  "OrderDate": null,
  "OrderEndDate": null,
  "OrderReferenceNumber": null,
  "OrderStartDate": null,
  "OriginalOrderNumber": null,
  "ParentOrder": null,
  "PartnerAccount": null,
  "PaymentStatus": "Pending",
  "PaymentTerm": null,
  "PODate": null,
  "PONumber": null,
  "PreviousVersion": null,
  "PriceList": {
    "Id": "32c3519a-f190-4f38-b05a-8063ef611492",
    "Name": "Test Price List - 7"
  },
  "PricingDate": null,
  "PrimaryContact": {
    "Id": "ddfec712-8827-4684-8287-1373e4f1f43d",
    "Name": "Conga"
  },
  "ProposalId": null,
  "PurchaseId": null,
  "PurchaseOrder": null,
  "ReadyForBillingDate": null,
  "ReadyForRevRecDate": null,
  "ReadyForWorkflow": false,
  "RelatedOpportunity": null,
  "ShipToAccount": {
    "Id": "dcb42e39-15c2-4895-aa35-53ee6c140d78",
    "Name": "Conga"
  },
  "SingleTransactionAdjustment": false,
  "SoldToAccount": {
    "Id": "dcb42e39-15c2-4895-aa35-53ee6c140d78",
    "Name": "Conga"
  },
  "Source": "Account",
  "SourceChannel": "Direct",
  "Status": "Draft",
  "Type": "New",
  "Currency": "USD"
}
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.

MethodPATCH
Endpoint/orders
Request URLhttps://<URL_of_the_Instance>/api/order/v1/orders/orderid
Request

The following sample code updates the primary contact that is associated with order3. 

{
     "AutoActivateOrder": false,
     "PrimaryContact": {
          "Id": "<A unique ID of the primary contact>",
          "Name": "<Name of the primary contact>"
     },     
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:

{
  "ActivatedDate": "2022-07-18T16:23:07",
  "AmendmentEffectiveDate": null,
  "AutoActivateOrder": false,
  "BillingPreference": null,
  "BillToAccount": {
    "Id": "dcb42e39-15c2-4895-aa35-53ee6c140d78",
    "Name": "Conga"
  },
  "CancelledDate": null,
  "CompletedDate": null,
  "ConfigurationEffectiveDate": null,
  "ConfigurationSyncDate": null,
  "Description": "This is a sample order", //Updated order description
  "FulfilledDate": null,
  "LegalEntity": null,
  "Location": null,
  "NextVersion": null,
  "OrderAmount": {
    "Value": 100,
    "DisplayValue": 100,
    "CurrencyCode": "USD",
    "CurrencySymbol": "$"
  },
  "OrderDate": null,
  "OrderEndDate": null,
  "OrderReferenceNumber": null,
  "OrderStartDate": null,
  "OriginalOrderNumber": null,
  "ParentOrder": null,
  "PartnerAccount": null,
  "PaymentStatus": "Pending",
  "PaymentTerm": null,
  "PODate": null,
  "PONumber": null,
  "PreviousVersion": null,
  "PriceList": {
    "Id": "32c3519a-f190-4f38-b05a-8063ef611492",
    "Name": "Test Price List - 7"
  },
  "PricingDate": null,
  "PrimaryContact": {
    "Id": "ddfec712-8827-4684-8287-1373e4f1f43d",
    "Name": "Conga"
  },
  "Proposal": null,
  "PurchaseId": null,
  "PurchaseOrder": null,
  "ReadyForBillingDate": null,
  "ReadyForRevRecDate": null,
  "ReadyForWorkflow": false,
  "RelatedOpportunity": null,
  "ShipToAccount": {
    "Id": "25c6d8a5-12c7-4970-ac96-87335ea888f1", //Updated ShipTo account id
    "Name": "AutoQuoteShipToRLPAccount_"
  },
  "SingleTransactionAdjustment": false,
  "SoldToAccount": {
    "Id": "dcb42e39-15c2-4895-aa35-53ee6c140d78",
    "Name": "Conga"
  },
  "Source": "Account",
  "SourceChannel": "Direct",
  "Status": "Pending",
  "Type": "New",
  "Currency": "USD",
  "Id": "f35934bc-b04b-4fe8-990a-5676c7615f2a",
  "Name": "Order3",
  "CreatedBy": {
    "Id": "ddfec712-8827-4684-8287-1373e4f1f43d",
    "Name": "Conga User"
  },
  "CreatedDate": "2022-07-18T16:23:07",
  "ModifiedBy": {
    "Id": "d717a075-9cbf-480c-b230-837e0e6dee75",
    "Name": "Test User"
  },
  "ModifiedDate": "2023-02-07T06:38:18.6814916",
  "ExternalId": null,
  "ProposalId": null
}
CODE