curl --request POST \
--url https://store.salesive.com/api/v1/orders/from-cart \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-shop-id: <api-key>' \
--data '
{
"productIds": [
"<string>"
],
"items": [
{
"productId": "<string>",
"variantId": "<string>"
}
],
"indices": [
1
],
"additionalInfo": [
{
"label": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://store.salesive.com/api/v1/orders/from-cart"
payload = {
"productIds": ["<string>"],
"items": [
{
"productId": "<string>",
"variantId": "<string>"
}
],
"indices": [1],
"additionalInfo": [
{
"label": "<string>",
"value": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"x-shop-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'x-shop-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
productIds: ['<string>'],
items: [{productId: '<string>', variantId: '<string>'}],
indices: [1],
additionalInfo: [{label: '<string>', value: '<string>'}]
})
};
fetch('https://store.salesive.com/api/v1/orders/from-cart', 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/from-cart",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'productIds' => [
'<string>'
],
'items' => [
[
'productId' => '<string>',
'variantId' => '<string>'
]
],
'indices' => [
1
],
'additionalInfo' => [
[
'label' => '<string>',
'value' => '<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/from-cart"
payload := strings.NewReader("{\n \"productIds\": [\n \"<string>\"\n ],\n \"items\": [\n {\n \"productId\": \"<string>\",\n \"variantId\": \"<string>\"\n }\n ],\n \"indices\": [\n 1\n ],\n \"additionalInfo\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://store.salesive.com/api/v1/orders/from-cart")
.header("Authorization", "Bearer <token>")
.header("x-shop-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"productIds\": [\n \"<string>\"\n ],\n \"items\": [\n {\n \"productId\": \"<string>\",\n \"variantId\": \"<string>\"\n }\n ],\n \"indices\": [\n 1\n ],\n \"additionalInfo\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://store.salesive.com/api/v1/orders/from-cart")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["x-shop-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productIds\": [\n \"<string>\"\n ],\n \"items\": [\n {\n \"productId\": \"<string>\",\n \"variantId\": \"<string>\"\n }\n ],\n \"indices\": [\n 1\n ],\n \"additionalInfo\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\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>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"zipCode": "<string>",
"country": "<string>",
"phoneNumber": "<string>"
},
"payment": "<string>",
"shipment": "<string>",
"notes": "<string>",
"additionalInfo": [
{
"label": "<string>",
"value": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}Create order from cart
Create an order from items in the authenticated shopper’s cart.
curl --request POST \
--url https://store.salesive.com/api/v1/orders/from-cart \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-shop-id: <api-key>' \
--data '
{
"productIds": [
"<string>"
],
"items": [
{
"productId": "<string>",
"variantId": "<string>"
}
],
"indices": [
1
],
"additionalInfo": [
{
"label": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://store.salesive.com/api/v1/orders/from-cart"
payload = {
"productIds": ["<string>"],
"items": [
{
"productId": "<string>",
"variantId": "<string>"
}
],
"indices": [1],
"additionalInfo": [
{
"label": "<string>",
"value": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"x-shop-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'x-shop-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
productIds: ['<string>'],
items: [{productId: '<string>', variantId: '<string>'}],
indices: [1],
additionalInfo: [{label: '<string>', value: '<string>'}]
})
};
fetch('https://store.salesive.com/api/v1/orders/from-cart', 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/from-cart",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'productIds' => [
'<string>'
],
'items' => [
[
'productId' => '<string>',
'variantId' => '<string>'
]
],
'indices' => [
1
],
'additionalInfo' => [
[
'label' => '<string>',
'value' => '<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/from-cart"
payload := strings.NewReader("{\n \"productIds\": [\n \"<string>\"\n ],\n \"items\": [\n {\n \"productId\": \"<string>\",\n \"variantId\": \"<string>\"\n }\n ],\n \"indices\": [\n 1\n ],\n \"additionalInfo\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://store.salesive.com/api/v1/orders/from-cart")
.header("Authorization", "Bearer <token>")
.header("x-shop-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"productIds\": [\n \"<string>\"\n ],\n \"items\": [\n {\n \"productId\": \"<string>\",\n \"variantId\": \"<string>\"\n }\n ],\n \"indices\": [\n 1\n ],\n \"additionalInfo\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://store.salesive.com/api/v1/orders/from-cart")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["x-shop-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productIds\": [\n \"<string>\"\n ],\n \"items\": [\n {\n \"productId\": \"<string>\",\n \"variantId\": \"<string>\"\n }\n ],\n \"indices\": [\n 1\n ],\n \"additionalInfo\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\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>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"zipCode": "<string>",
"country": "<string>",
"phoneNumber": "<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
POST /orders/from-cart
Authorization: Bearer {{token}}
x-shop-id: {{shopId}}
Content-Type: application/json
{}
Headers
| Header | Type | Description |
|---|---|---|
Authorization | string | Provide the customer token as Bearer <jwt>. |
x-shop-id | string | Identify the shop that owns the order. |
Content-Type | string | Always set to application/json. |
Body parameters
You can create an order using one of the following methods:| Field | Type | Required | Description |
|---|---|---|---|
productIds | array | No | Array of product IDs to include (any variants of these products). |
items | array | No | Array of explicit items with productId and optional variantId. |
indices | array | No | Array of 0-based cart item positions to include. |
additionalInfo | array | No | Custom labelled key/value info to attach to the order — see below. |
additionalInfo entries
Attach custom fields to the order (e.g. a gift message or delivery
instructions). Each entry has a required label and an optional value. Entries
without a label are dropped, and the list is capped at 50 entries.
| Field | Type | Required | Description |
|---|---|---|---|
label | string | Yes | The field name (max 100 characters). |
value | string | No | The field value (max 2000 characters). |
productId, so select them with indices
(0-based cart positions) or send an empty body to include the whole cart. The
resulting order items carry an itemType of product, food, or service;
service items reference service and include any selectedAddons. Service
(business) orders are non-shippable, so shippingCost is 0 and no shipment is
created.Request examples
Create order from entire cart
{}
Create order from selected products
{
"productIds": [
"68e5bb463a1fc56a8ac150bf",
"68e5bb463a1fc56a8ac150c0"
]
}
Create order from explicit items
{
"items": [
{ "productId": "68e5bb463a1fc56a8ac150bf" },
{ "productId": "68e5bb463a1fc56a8ac150bf", "variantId": "68e5c1303a1fc56a8ac151e2" }
]
}
Create order from cart indices
{
"indices": [0, 2]
}
Create order with additional info
{
"additionalInfo": [
{ "label": "Gift message", "value": "Happy birthday!" },
{ "label": "Delivery instructions", "value": "Leave at the front desk" }
]
}
Successful response
{
"status": 200,
"success": true,
"message": "Order created from cart",
"data": {
"_id": "6a27d632289b87893fcbde35",
"user": "69360693a7a8f7dc8ae32d6d",
"shop": "68b8f52575da81b332af29f1",
"items": [
{
"product": "69fb494e51280f9f65d059ae",
"variant": null,
"name": "Wristwatch",
"price": 45000,
"quantity": 1,
"imageUrl": "https://cdn.salesive.com/products/wristwatch.webp",
"_id": "6a27d632289b87893fcbde36"
}
],
"status": "pending",
"source": "online",
"paymentMethod": "other",
"payment": null,
"discount": 0,
"coupon": null,
"subtotal": 45000,
"shippingCost": 0,
"tax": 0,
"fee": 675,
"additionalInfo": [
{ "label": "Gift message", "value": "Happy birthday!" }
],
"posCustomerName": null,
"posCustomerEmail": null,
"posCustomerPhone": null,
"shipment": null,
"deleted": false,
"deletedAt": null,
"orderId": 17,
"createdAt": "2026-06-09T09:00:34.748Z",
"updatedAt": "2026-06-09T09:00:34.748Z",
"__v": 0,
"total": 45675,
"amount": 45000,
"id": "6a27d632289b87893fcbde35"
}
}
Error response
{
"status": 400,
"success": false,
"message": "Cart is empty",
"data": {}
}
Authorizations
JWT issued by the Salesive Store API for authenticated shoppers.
Optional storefront identifier sent as a header to scope responses to a specific shop. Try It requests remember this value once provided.
Headers
Optional identifier that scopes responses to a specific storefront when the referer cannot be inferred.
Body
If no parameters provided, entire cart will be converted to order.
Array of product IDs to include (any variants of these products).
Array of explicit items with productId and optional variantId.
Show child attributes
Show child attributes
Array of 0-based cart item positions to include.
x >= 0Custom labelled key/value info to attach to the order (e.g. gift message, delivery instructions). Max 50 entries.
50Show child attributes
Show child attributes
Was this page helpful?

