Update a Cart Item

Request Parameters

🏷️ header · 🔗 path · 📦 body field · unmarked parameters are query params

ParameterTypeRequiredDescription
Locally-Api-Token 🏷️stringNoLocally issued API key.
cart_hash 🔗stringYesUnique cart identifier.
upc 🔗stringYesVariant-level identifier for item that exists in cart.
status 📦stringYesOne of: confirm, reject.
confirmed_qty 📦integerNoAccept fewer units than were ordered. A whole number from 1 to the quantity ordered; send the full ordered quantity, or omit the field, for an ordinary confirm. To accept none, send a status of reject instead. In-store pickup and reserve orders only.
sts_status 📦stringNoOne of: confirm-brand, reject-brand, processing, shipped.
reason 📦stringNoAn sts_status of reject-brand requires a reason.
refund 📦booleanNoOnly include if a refund is required.
order_resolution 📦stringNo1 — The shopper purchased this item (and this item only) · 2 — The shopper purchased this item and additional products · 3 — The shopper showed up, but purchased a different product than this. · 4 — The shopper showed up but did not purchase anything · 5 — No sale/the shopper did not show up to the store.
message 📦stringNo
delivery_estimate_id 📦numberNo
scheduled_dispatch_at 📦stringNoThis value must be in UTC time in ISO 8601 format. Example: 2026-02-10T19:25:27Z.

Example Request

curl 'https://www.locally.com/api/v2/cart/{{CART_HASH}}/{{UPC}}' \
--request POST \
--header 'Locally-Api-Token: {{API_TOKEN}}' \
--header 'Content-Type: application/json' \
--data '{
  "status": "confirm",
  "message": "Confirmed! We will text you when your order is out for delivery.",
  "delivery_estimate_id": 928101,
  "scheduled_dispatch_at": "2026-02-10T19:25:27Z"
}'
const response = await fetch('https://www.locally.com/api/v2/cart/{{CART_HASH}}/{{UPC}}', {
  method: 'POST',
  headers: {
    'Locally-Api-Token': '{{API_TOKEN}}',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    status: 'confirm',
    message: 'Confirmed! We will text you when your order is out for delivery.',
    delivery_estimate_id: 928101,
    scheduled_dispatch_at: '2026-02-10T19:25:27Z'
  })
});

const data = await response.json();
console.log(data);
import requests

response = requests.post(
    'https://www.locally.com/api/v2/cart/{{CART_HASH}}/{{UPC}}',
    headers={'Locally-Api-Token': '{{API_TOKEN}}'},
    json={
        'status': 'confirm',
        'message': 'Confirmed! We will text you when your order is out for delivery.',
        'delivery_estimate_id': 928101,
        'scheduled_dispatch_at': '2026-02-10T19:25:27Z',
    },
)

print(response.json())

Each request performs one operation on the cart item: send status (confirm or reject) for BOPIS/ROPIS orders, sts_status (confirm-brand, reject-brand, processing, or shipped) for Ship to Store orders (reject-brand requires a reason), refund to refund a confirmed item, order_resolution to record the order outcome, or message to message the shopper. When confirming a delivery order — as in the example — you may also include delivery_estimate_id and scheduled_dispatch_at (UTC, ISO 8601). A message or reason accompanying a status change is relayed to the shopper by text/email.

Confirming a partial quantity

When you only have some of the units a shopper ordered, confirm the quantity you can actually fill by sending confirmed_qty alongside status: confirm:

{
  "status": "confirm",
  "confirmed_qty": 2,
  "message": "We only had 2 of these in stock, so those are being held for you."
}

The order is reduced to that quantity: the shopper is charged for confirmed_qty units instead of the full order, sales tax is recalculated on the smaller amount, and Get a Single Cart then reports the accepted qty alongside the original_qty that was ordered.

Rules worth coding against:

  • confirmed_qty must be a whole number from 1 to the quantity ordered. Zero, negative values, decimals and anything above the ordered quantity are rejected, and the item is left untouched.
  • To accept none of the units, send a status of reject. Do not send confirmed_qty: 0.
  • Sending the full ordered quantity behaves exactly like a confirm without the field, and no original quantity is recorded.
  • Only in-store pickup (BOPIS) and reserve (ROPIS) orders support it. Ship to Store, delivery, affiliate, marketplace and prepaid orders are rejected with a message naming the order type — confirm those in full, or reject them.

Example Response

{
  "status": true,
  "debug": "Inputs: array (\n  'status' => 'confirm',\n  'message' => 'Confirmed! We will text you when your order is out for delivery.',\n  'delivery_estimate_id' => 928101,\n  'scheduled_dispatch_at' => '2026-02-10T19:25:27Z',\n) | ",
  "code": 101
}

Response Explanation

  • statustrue when the update was applied (HTTP 200); failures return status: false with HTTP 500 and a message field explaining why (for example, a disallowed status transition).
  • debug — Diagnostic echo of the request body as Locally parsed it (PHP var_export format), useful when troubleshooting rejected updates; not intended to be parsed programmatically.
  • code — Returned for status updates: 101 means the change was applied; 102 means the item was already in the requested state (treated as success, nothing changed).
Path Params
string
required

Unique cart identifier

string
required

Variant-level identifier for item that exists in cart

Body Params
string
enum
required
Allowed:
integer
≥ 1

Send with a status of confirm to accept fewer units than were ordered. Must be a whole number from 1 to the quantity ordered; sending the full ordered quantity is an ordinary confirm. To accept none, send a status of reject instead. Supported on in-store pickup and reserve orders only.

string
enum
Allowed:
string

An sts_status of reject-brand requires a reason.

boolean

Only include if a refund is required

string

1 - The shopper purchased this item (and this item only)
2 - The shopper purchased this item and additional products
3 - The shopper showed up, but purchased a different product than this.
4 - The shopper showed up but did not purchase anything
5 - No sale/the shopper did not show up to the store

string
number
string

This value must be in UTC time in ISO 8601 format. Example: 2026-02-10T19:25:27Z

Headers
string

Locally issued API key

Responses

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json