---
title: "Edit an order/cart"
method: PATCH
path: "/data/v3/orders/{id}"
tags: ["Sales data"]
---

# Edit an order/cart

`PATCH /data/v3/orders/{id}`

Edit an entire order or an abandoned cart with its custom fields.

## Path parameters

- `id` string, required

## Request body

- object
  - `contact_id` string
  - `store_external_id` string
  - `ordered_at` string — When the order was purchased (local timezone).
  - `discount_amount` number
  - `shipping_amount` number
  - `total_price` number
  - `tax_amount` number
  - `sales_person` string
  - `completed` boolean — Order is purchased or not
  - `currency` string
  - `products` object[] — empty array will erase existing order lines. In order to avoid deleting data, either don't specify 'products' or set it to null
    - `product_id` string
    - `unit_price` number
    - `quantity` integer
    - `discount_amount` number
    - `tax_amount` number
    - `currency` string
    - `total_line_amount` number
  - `custom_fields` object[] — custom fields is patched too so you can only set some of them, other custom fields will not be changed
    - `id` integer
    - `name` string
    - `value` string

## Response `200`

Order data.

## Other responses

- `400` — The request validation failed.
- `401` — Authentication failed.
- `403` — Forbidden.
- `404` — Order not found.

---

[API](https://skmtc.net/splio/apis/splio-customer-platform.md) · [All operations](https://skmtc.net/splio/apis/splio-customer-platform/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/splio/splio-customer-platform/revisions/2ff4735f665c/schema)
