Rest API: Update Order
This article details the Update Order section of the Rest API documentation.
Overview
This call updates Order, with order rate plan charge, Using Update Order method we can.
- Order with one charge.
- Order with multiple charges.
HTTP Method
PATCH
Request URL
https://domain/services/apexrest/Invoice_API/invoiceit/orders
The domain name Example – “eu2.salesforce.com”.
REST Request: Update Order With One Order Rate Plan Charge
Request:
{
"Name": "Order Rest Api update",
"Id": "a0Oi000000CMGzi",
"OrderRatePlanCharge":
[{
"Id": "a0Mi0000006ccTZEAY",
"invoiceit_s__Quantity__c": 2,
"invoiceit_s__Unit_Price__c": 50,
"invoiceit_s__Cost_Price__c": 25
}]
}
Response:
{
"success": true,
"orderName": "Order Rest Api update",
"orderId": " a0Oi000000CMGziEAH "
}
REST Request: update order with multiple charges
Request:
{
"Id": "a0Hb00000035lE0",
"OrderRatePlanCharge":
[{
"Id": "a0Fb0000002MA6dEAG",
"invoiceit_s__Unit_Price__c": 150,
"invoiceit_s__Quantity__c": 5
},{
"Id": "a0Fb0000002MA6eEAG",
"invoiceit_s__Unit_Price__c": 200,
"invoiceit_s__Quantity__c": 5
}]
}
Response:
{
"success": true,
"orderName": "Order Rest Api 007",
"orderId": " a0Oi000000CMGziEAH "
}