Skip to main content
PATCH
/
orders
/
{id}
Update order
curl --request PATCH \
  --url https://store.salesive.com/api/v1/orders/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-shop-id: <api-key>' \
  --data '
{
  "additionalInfo": [
    {
      "label": "<string>",
      "value": "<string>"
    }
  ],
  "notes": "<string>"
}
'
import requests

url = "https://store.salesive.com/api/v1/orders/{id}"

payload = {
"additionalInfo": [
{
"label": "<string>",
"value": "<string>"
}
],
"notes": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"x-shop-id": "<api-key>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'x-shop-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({additionalInfo: [{label: '<string>', value: '<string>'}], notes: '<string>'})
};

fetch('https://store.salesive.com/api/v1/orders/{id}', 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://store.salesive.com/api/v1/orders/{id}",
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([
'additionalInfo' => [
[
'label' => '<string>',
'value' => '<string>'
]
],
'notes' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-shop-id: <api-key>"
],
]);

$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://store.salesive.com/api/v1/orders/{id}"

payload := strings.NewReader("{\n \"additionalInfo\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"notes\": \"<string>\"\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("x-shop-id", "<api-key>")
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://store.salesive.com/api/v1/orders/{id}")
.header("Authorization", "Bearer <token>")
.header("x-shop-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"additionalInfo\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"notes\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://store.salesive.com/api/v1/orders/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["x-shop-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"additionalInfo\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"notes\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "status": 123,
  "success": true,
  "message": "<string>",
  "data": {
    "_id": "<string>",
    "orderId": 123,
    "user": "<string>",
    "shop": "<string>",
    "items": [
      {
        "product": "<string>",
        "name": "<string>",
        "price": 123,
        "quantity": 2,
        "variant": "<string>",
        "sku": "<string>",
        "variantAttributes": {},
        "imageUrl": "<string>"
      }
    ],
    "subtotal": 123,
    "shippingCost": 123,
    "total": 123,
    "shippingAddress": {
      "fullName": "<string>",
      "addressLine1": "<string>",
      "city": "<string>",
      "state": "<string>",
      "zipCode": "<string>",
      "country": "<string>",
      "phoneNumber": "<string>",
      "addressLine2": "<string>"
    },
    "payment": "<string>",
    "shipment": "<string>",
    "notes": "<string>",
    "additionalInfo": [
      {
        "label": "<string>",
        "value": "<string>"
      }
    ],
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

Request

PATCH /orders/{id}
Authorization: Bearer {{token}}
x-shop-id: {{shopId}}
Content-Type: application/json

{
  "additionalInfo": [
    { "label": "Gift message", "value": "Happy birthday!" }
  ]
}

Headers

HeaderTypeDescription
AuthorizationstringProvide the customer token as Bearer <jwt>.
x-shop-idstringIdentify the shop that owns the order.
Content-TypestringAlways set to application/json.

Path parameters

ParameterTypeRequiredDescription
idstringYesThe order’s ObjectId.

Body parameters

At least one field must be provided. Only the shopper who placed the order can update it.
FieldTypeRequiredDescription
additionalInfoarrayNoReplaces the order’s additional info. Each entry has label and value — see below.
notesstringNoFree-text notes on the order (max 5000 characters).

additionalInfo entries

FieldTypeRequiredDescription
labelstringYesThe field name (max 100 characters).
valuestringNoThe field value (max 2000 characters).
additionalInfo is replaced wholesale, not merged. Send the full list you want the order to end up with. Entries without a label are dropped and the list is capped at 50 entries.

Successful response

{
    "status": 200,
    "success": true,
    "message": "Order updated",
    "data": {
        "_id": "6a27d632289b87893fcbde35",
        "orderId": 17,
        "status": "pending",
        "additionalInfo": [
            { "label": "Gift message", "value": "Happy birthday!" }
        ],
        "notes": null,
        "subtotal": 45000,
        "shippingCost": 0,
        "total": 45675
    }
}

Error response

{
    "status": 404,
    "success": false,
    "message": "Order not found",
    "data": {}
}

Authorizations

Authorization
string
header
required

JWT issued by the Salesive Store API for authenticated shoppers.

x-shop-id
string
header
required

Optional storefront identifier sent as a header to scope responses to a specific shop. Try It requests remember this value once provided.

Headers

x-shop-id
string

Optional identifier that scopes responses to a specific storefront when the referer cannot be inferred.

Path Parameters

id
string
required

The ID of the order to update

Body

application/json

At least one field must be provided.

additionalInfo
object[]

Replaces the order's additional info with this list of labelled key/value entries.

Maximum array length: 50
notes
string

Free-text notes on the order.

Maximum string length: 5000

Response

Order updated successfully.

status
integer
required
success
boolean
required
message
string
required
data
object
required