Update single order
curl --request PATCH \
--url https://prod01.copilot.fabric.inc/data-subscription/v1/orders/{orderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"order": {
"scheduledDate": "2019-01-01T00:00:00.000Z",
"status": "SCHEDULED",
"lineItems": [
{
"Item": {
"quantity": 1,
"weight": 10,
"weightUnit": "lb"
},
"customAttributes": {
"storeId": "60cb07fc20387b000821c5c3",
"associateId": 1,
"trackingUrl": "609436d21baded0008945b05"
}
}
]
}
}
'import requests
url = "https://prod01.copilot.fabric.inc/data-subscription/v1/orders/{orderId}"
payload = { "order": {
"scheduledDate": "2019-01-01T00:00:00.000Z",
"status": "SCHEDULED",
"lineItems": [
{
"Item": {
"quantity": 1,
"weight": 10,
"weightUnit": "lb"
},
"customAttributes": {
"storeId": "60cb07fc20387b000821c5c3",
"associateId": 1,
"trackingUrl": "609436d21baded0008945b05"
}
}
]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
order: {
scheduledDate: '2019-01-01T00:00:00.000Z',
status: 'SCHEDULED',
lineItems: [
{
Item: {quantity: 1, weight: 10, weightUnit: 'lb'},
customAttributes: {
storeId: '60cb07fc20387b000821c5c3',
associateId: 1,
trackingUrl: '609436d21baded0008945b05'
}
}
]
}
})
};
fetch('https://prod01.copilot.fabric.inc/data-subscription/v1/orders/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://prod01.copilot.fabric.inc/data-subscription/v1/orders/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'order' => [
'scheduledDate' => '2019-01-01T00:00:00.000Z',
'status' => 'SCHEDULED',
'lineItems' => [
[
'Item' => [
'quantity' => 1,
'weight' => 10,
'weightUnit' => 'lb'
],
'customAttributes' => [
'storeId' => '60cb07fc20387b000821c5c3',
'associateId' => 1,
'trackingUrl' => '609436d21baded0008945b05'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://prod01.copilot.fabric.inc/data-subscription/v1/orders/{orderId}"
payload := strings.NewReader("{\n \"order\": {\n \"scheduledDate\": \"2019-01-01T00:00:00.000Z\",\n \"status\": \"SCHEDULED\",\n \"lineItems\": [\n {\n \"Item\": {\n \"quantity\": 1,\n \"weight\": 10,\n \"weightUnit\": \"lb\"\n },\n \"customAttributes\": {\n \"storeId\": \"60cb07fc20387b000821c5c3\",\n \"associateId\": 1,\n \"trackingUrl\": \"609436d21baded0008945b05\"\n }\n }\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://prod01.copilot.fabric.inc/data-subscription/v1/orders/{orderId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order\": {\n \"scheduledDate\": \"2019-01-01T00:00:00.000Z\",\n \"status\": \"SCHEDULED\",\n \"lineItems\": [\n {\n \"Item\": {\n \"quantity\": 1,\n \"weight\": 10,\n \"weightUnit\": \"lb\"\n },\n \"customAttributes\": {\n \"storeId\": \"60cb07fc20387b000821c5c3\",\n \"associateId\": 1,\n \"trackingUrl\": \"609436d21baded0008945b05\"\n }\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod01.copilot.fabric.inc/data-subscription/v1/orders/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"order\": {\n \"scheduledDate\": \"2019-01-01T00:00:00.000Z\",\n \"status\": \"SCHEDULED\",\n \"lineItems\": [\n {\n \"Item\": {\n \"quantity\": 1,\n \"weight\": 10,\n \"weightUnit\": \"lb\"\n },\n \"customAttributes\": {\n \"storeId\": \"60cb07fc20387b000821c5c3\",\n \"associateId\": 1,\n \"trackingUrl\": \"609436d21baded0008945b05\"\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"responseStatus": "OK",
"message": "Request processed successfully",
"data": {
"order": {
"status": "SCHEDULED",
"totalAmount": 100,
"currencyCode": "USD",
"scheduledDate": "2019-01-01T00:00:00.000Z",
"customer": {
"customerReferenceId": "12345",
"locale": "en_US",
"email": "customer@example.com",
"firstName": "Pat",
"lastName": "Kake",
"contactnumber": "5555551234",
"middleName": "E",
"segments": [
"employee"
],
"employeeId": "345",
"status": "ACTIVE",
"isDeleted": false,
"DeletedAt": "2021-01-01T00:00:00.000Z",
"createdAt": "2019-10-12T21:35:05.756Z",
"updatedAt": "2021-10-14T05:40:55.997Z",
"communicationPreference": {
"email": true,
"sms": true
}
},
"shipTo": {
"name": {
"firstName": "Pat",
"lastName": "Kake",
"middleName": "E"
},
"streetAddress": {
"street1": "123 Main St",
"street2": "Suite 100"
},
"city": "Boston",
"state": "MA",
"postalCode": "02127",
"country": "US",
"phone": {
"number": "5555551234",
"kind": "home"
}
},
"billTo": {
"name": {
"firstName": "Pat",
"lastName": "Kake",
"middleName": "E"
},
"streetAddress": {
"street1": "123 Main St",
"street2": "Suite 100"
},
"city": "Boston",
"state": "MA",
"postalCode": "02127",
"country": "US",
"phone": {
"number": "5555551234",
"kind": "home"
}
},
"paymentDetails": {
"paymentIdentifier": {
"cardIdentifier": "1234",
"expiryDate": "12/20"
},
"paymentMethod": "credit_card",
"paymentKind": "Visa"
},
"isDeleted": false,
"deletedAt": "2019-01-01T00:00:00.000Z",
"id": "6384462ab645220008a4358a",
"totalTax": 10,
"totalDiscount": 10,
"lineItems": [
{
"lineItemId": 1,
"subscription": {
"plan": {
"frequency": 30,
"frequencyType": "Daily",
"id": "1001"
},
"id": "6256610bc312410009b7390b"
},
"item": {
"id": 1000000006,
"sku": "MOBO-X570",
"quantity": 1,
"itemPrice": {
"price": 100,
"currencyCode": "USD"
},
"weight": 10,
"weightUnit": "lb",
"title": "Vitamin",
"description": "Vitamin C",
"tax": {
"taxCode": "FR020000",
"taxAmount": 10,
"currencyCode": "USD"
}
},
"shipping": {
"shipmentCarrier": "USPS",
"shipmentMethod": "Ground",
"shipmentInstructions": "Please leave the package in the box",
"taxCode": "SHP020000",
"shippingAmount": 10,
"taxAmount": 1,
"currencyCode": "USD"
},
"offer": {
"id": "SUB-E10717",
"source": "PDP"
},
"customAttributes": {
"storeId": "60cb07fc20387b000821c5c3",
"associateId": 1,
"trackingUrl": "609436d21baded0008945b05"
}
}
],
"createdAt": "2021-10-12T21:35:05.756Z",
"updatedAt": "2021-10-14T05:40:55.997Z",
"statusUpdatedAt": "2021-10-14T10:24:36.468Z",
"Retry": {
"maxRetries": 3,
"retryType": "PAYMENT RETRY",
"retryAfterDays": 1,
"retryCount": 2
},
"error": {
"errorCode": "ORDER_NOT_FOUND",
"errorMessage": "The order is not found"
}
}
}
}{
"responseStatus": "BAD_REQUEST",
"message": "Bad request"
}{
"Message": "User is not authorized to access this resource with an explicit deny"
}{
"responseStatus": "NOT_FOUND",
"message": "Not found"
}Orders
Update single order
Update single order, specified by order ID
PATCH
/
v1
/
orders
/
{orderId}
Update single order
curl --request PATCH \
--url https://prod01.copilot.fabric.inc/data-subscription/v1/orders/{orderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"order": {
"scheduledDate": "2019-01-01T00:00:00.000Z",
"status": "SCHEDULED",
"lineItems": [
{
"Item": {
"quantity": 1,
"weight": 10,
"weightUnit": "lb"
},
"customAttributes": {
"storeId": "60cb07fc20387b000821c5c3",
"associateId": 1,
"trackingUrl": "609436d21baded0008945b05"
}
}
]
}
}
'import requests
url = "https://prod01.copilot.fabric.inc/data-subscription/v1/orders/{orderId}"
payload = { "order": {
"scheduledDate": "2019-01-01T00:00:00.000Z",
"status": "SCHEDULED",
"lineItems": [
{
"Item": {
"quantity": 1,
"weight": 10,
"weightUnit": "lb"
},
"customAttributes": {
"storeId": "60cb07fc20387b000821c5c3",
"associateId": 1,
"trackingUrl": "609436d21baded0008945b05"
}
}
]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
order: {
scheduledDate: '2019-01-01T00:00:00.000Z',
status: 'SCHEDULED',
lineItems: [
{
Item: {quantity: 1, weight: 10, weightUnit: 'lb'},
customAttributes: {
storeId: '60cb07fc20387b000821c5c3',
associateId: 1,
trackingUrl: '609436d21baded0008945b05'
}
}
]
}
})
};
fetch('https://prod01.copilot.fabric.inc/data-subscription/v1/orders/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://prod01.copilot.fabric.inc/data-subscription/v1/orders/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'order' => [
'scheduledDate' => '2019-01-01T00:00:00.000Z',
'status' => 'SCHEDULED',
'lineItems' => [
[
'Item' => [
'quantity' => 1,
'weight' => 10,
'weightUnit' => 'lb'
],
'customAttributes' => [
'storeId' => '60cb07fc20387b000821c5c3',
'associateId' => 1,
'trackingUrl' => '609436d21baded0008945b05'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://prod01.copilot.fabric.inc/data-subscription/v1/orders/{orderId}"
payload := strings.NewReader("{\n \"order\": {\n \"scheduledDate\": \"2019-01-01T00:00:00.000Z\",\n \"status\": \"SCHEDULED\",\n \"lineItems\": [\n {\n \"Item\": {\n \"quantity\": 1,\n \"weight\": 10,\n \"weightUnit\": \"lb\"\n },\n \"customAttributes\": {\n \"storeId\": \"60cb07fc20387b000821c5c3\",\n \"associateId\": 1,\n \"trackingUrl\": \"609436d21baded0008945b05\"\n }\n }\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://prod01.copilot.fabric.inc/data-subscription/v1/orders/{orderId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order\": {\n \"scheduledDate\": \"2019-01-01T00:00:00.000Z\",\n \"status\": \"SCHEDULED\",\n \"lineItems\": [\n {\n \"Item\": {\n \"quantity\": 1,\n \"weight\": 10,\n \"weightUnit\": \"lb\"\n },\n \"customAttributes\": {\n \"storeId\": \"60cb07fc20387b000821c5c3\",\n \"associateId\": 1,\n \"trackingUrl\": \"609436d21baded0008945b05\"\n }\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod01.copilot.fabric.inc/data-subscription/v1/orders/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"order\": {\n \"scheduledDate\": \"2019-01-01T00:00:00.000Z\",\n \"status\": \"SCHEDULED\",\n \"lineItems\": [\n {\n \"Item\": {\n \"quantity\": 1,\n \"weight\": 10,\n \"weightUnit\": \"lb\"\n },\n \"customAttributes\": {\n \"storeId\": \"60cb07fc20387b000821c5c3\",\n \"associateId\": 1,\n \"trackingUrl\": \"609436d21baded0008945b05\"\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"responseStatus": "OK",
"message": "Request processed successfully",
"data": {
"order": {
"status": "SCHEDULED",
"totalAmount": 100,
"currencyCode": "USD",
"scheduledDate": "2019-01-01T00:00:00.000Z",
"customer": {
"customerReferenceId": "12345",
"locale": "en_US",
"email": "customer@example.com",
"firstName": "Pat",
"lastName": "Kake",
"contactnumber": "5555551234",
"middleName": "E",
"segments": [
"employee"
],
"employeeId": "345",
"status": "ACTIVE",
"isDeleted": false,
"DeletedAt": "2021-01-01T00:00:00.000Z",
"createdAt": "2019-10-12T21:35:05.756Z",
"updatedAt": "2021-10-14T05:40:55.997Z",
"communicationPreference": {
"email": true,
"sms": true
}
},
"shipTo": {
"name": {
"firstName": "Pat",
"lastName": "Kake",
"middleName": "E"
},
"streetAddress": {
"street1": "123 Main St",
"street2": "Suite 100"
},
"city": "Boston",
"state": "MA",
"postalCode": "02127",
"country": "US",
"phone": {
"number": "5555551234",
"kind": "home"
}
},
"billTo": {
"name": {
"firstName": "Pat",
"lastName": "Kake",
"middleName": "E"
},
"streetAddress": {
"street1": "123 Main St",
"street2": "Suite 100"
},
"city": "Boston",
"state": "MA",
"postalCode": "02127",
"country": "US",
"phone": {
"number": "5555551234",
"kind": "home"
}
},
"paymentDetails": {
"paymentIdentifier": {
"cardIdentifier": "1234",
"expiryDate": "12/20"
},
"paymentMethod": "credit_card",
"paymentKind": "Visa"
},
"isDeleted": false,
"deletedAt": "2019-01-01T00:00:00.000Z",
"id": "6384462ab645220008a4358a",
"totalTax": 10,
"totalDiscount": 10,
"lineItems": [
{
"lineItemId": 1,
"subscription": {
"plan": {
"frequency": 30,
"frequencyType": "Daily",
"id": "1001"
},
"id": "6256610bc312410009b7390b"
},
"item": {
"id": 1000000006,
"sku": "MOBO-X570",
"quantity": 1,
"itemPrice": {
"price": 100,
"currencyCode": "USD"
},
"weight": 10,
"weightUnit": "lb",
"title": "Vitamin",
"description": "Vitamin C",
"tax": {
"taxCode": "FR020000",
"taxAmount": 10,
"currencyCode": "USD"
}
},
"shipping": {
"shipmentCarrier": "USPS",
"shipmentMethod": "Ground",
"shipmentInstructions": "Please leave the package in the box",
"taxCode": "SHP020000",
"shippingAmount": 10,
"taxAmount": 1,
"currencyCode": "USD"
},
"offer": {
"id": "SUB-E10717",
"source": "PDP"
},
"customAttributes": {
"storeId": "60cb07fc20387b000821c5c3",
"associateId": 1,
"trackingUrl": "609436d21baded0008945b05"
}
}
],
"createdAt": "2021-10-12T21:35:05.756Z",
"updatedAt": "2021-10-14T05:40:55.997Z",
"statusUpdatedAt": "2021-10-14T10:24:36.468Z",
"Retry": {
"maxRetries": 3,
"retryType": "PAYMENT RETRY",
"retryAfterDays": 1,
"retryCount": 2
},
"error": {
"errorCode": "ORDER_NOT_FOUND",
"errorMessage": "The order is not found"
}
}
}
}{
"responseStatus": "BAD_REQUEST",
"message": "Bad request"
}{
"Message": "User is not authorized to access this resource with an explicit deny"
}{
"responseStatus": "NOT_FOUND",
"message": "Not found"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Order ID General object ID
Example:
"606f01f441b8fc0008529916"
Body
application/json
Details to update order
Order details to be updated
Show child attributes
Show child attributes
Was this page helpful?
⌘I
