Update a Line Item
curl --request PATCH \
--url https://public-api.stora.co/2025-09/orders/{order_id}/line_items/{line_item_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"quantity": 2,
"price": {
"amount": 1499
}
}
'import requests
url = "https://public-api.stora.co/2025-09/orders/{order_id}/line_items/{line_item_id}"
payload = {
"quantity": 2,
"price": { "amount": 1499 }
}
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({quantity: 2, price: {amount: 1499}})
};
fetch('https://public-api.stora.co/2025-09/orders/{order_id}/line_items/{line_item_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://public-api.stora.co/2025-09/orders/{order_id}/line_items/{line_item_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([
'quantity' => 2,
'price' => [
'amount' => 1499
]
]),
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://public-api.stora.co/2025-09/orders/{order_id}/line_items/{line_item_id}"
payload := strings.NewReader("{\n \"quantity\": 2,\n \"price\": {\n \"amount\": 1499\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://public-api.stora.co/2025-09/orders/{order_id}/line_items/{line_item_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"quantity\": 2,\n \"price\": {\n \"amount\": 1499\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.stora.co/2025-09/orders/{order_id}/line_items/{line_item_id}")
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 \"quantity\": 2,\n \"price\": {\n \"amount\": 1499\n }\n}"
response = http.request(request)
puts response.read_body{
"line_item": {
"id": "olitm_1001cbd3d5fec937",
"created_at": "2025-02-22T14:41:00Z",
"discount_total": {
"amount": 1499,
"currency": "GBP",
"formatted": "£14.99"
},
"item": {
"id": "utype_3b3aed5cca33b11d"
},
"price": {
"amount": 1499,
"currency": "GBP",
"formatted": "£14.99"
},
"quantity": 2,
"tax": {
"amount": 0,
"currency": "GBP",
"formatted": "£0.00"
},
"total": {
"amount": 2998,
"currency": "GBP",
"formatted": "£29.98"
},
"total_excluding_tax": {
"amount": 2998,
"currency": "GBP",
"formatted": "£29.98"
},
"type": "unit_type",
"updated_at": "2025-02-22T14:41:00Z"
},
"meta": {
"request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
"curies": [
{
"name": "bo",
"href": "https://app.stora.test{rel}",
"templated": true,
"title": "Backoffice"
},
{
"name": "sf",
"href": "https://acme.stora.test{rel}",
"templated": true,
"title": "Storefront"
}
]
}
}{
"error": {
"code": "resource_not_found",
"details": [],
"links": [
{
"kind": "open_api",
"name": "OpenAPI specification",
"url": "https://docs.stora.test/2025-09/openapi.json"
},
{
"kind": "documentation",
"name": "Errors",
"url": "https://docs.stora.test/2025-09/guides/errors"
}
],
"message": "The Orders/Line Item was not found.",
"request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
"type": "invalid_request_error"
}
}{
"error": {
"code": "conflict",
"details": [],
"links": [
{
"kind": "open_api",
"name": "OpenAPI specification",
"url": "https://docs.stora.test/2025-09/openapi.json"
},
{
"kind": "documentation",
"name": "Errors",
"url": "https://docs.stora.test/2025-09/guides/errors"
}
],
"message": "The order must be in the draft status to modify its line items. The current status is completed.",
"request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
"type": "invalid_request_error"
}
}{
"error": {
"code": "invalid_content",
"details": [
{
"message": "Line item params can't be blank",
"pointer": "line_item_params"
}
],
"links": [
{
"kind": "open_api",
"name": "OpenAPI specification",
"url": "https://docs.stora.test/2025-09/openapi.json"
},
{
"kind": "documentation",
"name": "Errors",
"url": "https://docs.stora.test/2025-09/guides/errors"
}
],
"message": "The request body content is not valid.",
"request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
"type": "invalid_request_error"
}
}Orders / Line Items
Update a Line Item
Update an existing line item. Only line items from orders in draft status can be updated.
Required authorization scope: public.order:write
PATCH
/
2025-09
/
orders
/
{order_id}
/
line_items
/
{line_item_id}
Update a Line Item
curl --request PATCH \
--url https://public-api.stora.co/2025-09/orders/{order_id}/line_items/{line_item_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"quantity": 2,
"price": {
"amount": 1499
}
}
'import requests
url = "https://public-api.stora.co/2025-09/orders/{order_id}/line_items/{line_item_id}"
payload = {
"quantity": 2,
"price": { "amount": 1499 }
}
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({quantity: 2, price: {amount: 1499}})
};
fetch('https://public-api.stora.co/2025-09/orders/{order_id}/line_items/{line_item_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://public-api.stora.co/2025-09/orders/{order_id}/line_items/{line_item_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([
'quantity' => 2,
'price' => [
'amount' => 1499
]
]),
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://public-api.stora.co/2025-09/orders/{order_id}/line_items/{line_item_id}"
payload := strings.NewReader("{\n \"quantity\": 2,\n \"price\": {\n \"amount\": 1499\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://public-api.stora.co/2025-09/orders/{order_id}/line_items/{line_item_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"quantity\": 2,\n \"price\": {\n \"amount\": 1499\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.stora.co/2025-09/orders/{order_id}/line_items/{line_item_id}")
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 \"quantity\": 2,\n \"price\": {\n \"amount\": 1499\n }\n}"
response = http.request(request)
puts response.read_body{
"line_item": {
"id": "olitm_1001cbd3d5fec937",
"created_at": "2025-02-22T14:41:00Z",
"discount_total": {
"amount": 1499,
"currency": "GBP",
"formatted": "£14.99"
},
"item": {
"id": "utype_3b3aed5cca33b11d"
},
"price": {
"amount": 1499,
"currency": "GBP",
"formatted": "£14.99"
},
"quantity": 2,
"tax": {
"amount": 0,
"currency": "GBP",
"formatted": "£0.00"
},
"total": {
"amount": 2998,
"currency": "GBP",
"formatted": "£29.98"
},
"total_excluding_tax": {
"amount": 2998,
"currency": "GBP",
"formatted": "£29.98"
},
"type": "unit_type",
"updated_at": "2025-02-22T14:41:00Z"
},
"meta": {
"request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
"curies": [
{
"name": "bo",
"href": "https://app.stora.test{rel}",
"templated": true,
"title": "Backoffice"
},
{
"name": "sf",
"href": "https://acme.stora.test{rel}",
"templated": true,
"title": "Storefront"
}
]
}
}{
"error": {
"code": "resource_not_found",
"details": [],
"links": [
{
"kind": "open_api",
"name": "OpenAPI specification",
"url": "https://docs.stora.test/2025-09/openapi.json"
},
{
"kind": "documentation",
"name": "Errors",
"url": "https://docs.stora.test/2025-09/guides/errors"
}
],
"message": "The Orders/Line Item was not found.",
"request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
"type": "invalid_request_error"
}
}{
"error": {
"code": "conflict",
"details": [],
"links": [
{
"kind": "open_api",
"name": "OpenAPI specification",
"url": "https://docs.stora.test/2025-09/openapi.json"
},
{
"kind": "documentation",
"name": "Errors",
"url": "https://docs.stora.test/2025-09/guides/errors"
}
],
"message": "The order must be in the draft status to modify its line items. The current status is completed.",
"request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
"type": "invalid_request_error"
}
}{
"error": {
"code": "invalid_content",
"details": [
{
"message": "Line item params can't be blank",
"pointer": "line_item_params"
}
],
"links": [
{
"kind": "open_api",
"name": "OpenAPI specification",
"url": "https://docs.stora.test/2025-09/openapi.json"
},
{
"kind": "documentation",
"name": "Errors",
"url": "https://docs.stora.test/2025-09/guides/errors"
}
],
"message": "The request body content is not valid.",
"request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
"type": "invalid_request_error"
}
}Authorizations
BearerOAuth2
Bearer Token necessary to use API
Path Parameters
The ID of the order
The ID of the line item
Query Parameters
This endpoint supports expandable responses. For more, see the documentation page.
Was this page helpful?
⌘I