Skip to content

Update a product

PATCH
/products/{id}
curl --request PATCH \
--url https://example.com/products/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f \
--header 'Content-Type: application/json' \
--cookie bottle.session_token=<bottle.session_token> \
--data '{ "name": "example", "shortCode": "example", "sku": "example", "unitPrice": 1, "vatRate": 1, "charge": "deposit", "chargePeriod": "once", "chargeForProductId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "gasTypeId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "weightKg": 1, "volumeLitres": 1, "notes": "example", "archived": true }'

Archiving keeps it off new orders and leaves old ones alone, since what was sold last year is a fact about last year.

id
required

UUID v7

string format: uuid
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f

UUID v7

Media typeapplication/json
object
name
string
>= 1 characters <= 120 characters
shortCode
string | null
<= 20 characters
sku
string | null
<= 64 characters
unitPrice

Pence, excluding VAT.

integer
<= 100000000
vatRate

VAT in basis points. Defaults to 2000, the standard 20%.

integer
<= 10000
charge
string | null
Allowed values: deposit hire
chargePeriod
string | null
Allowed values: once daily weekly monthly
chargeForProductId

UUID v7

string | null format: uuid
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f
gasTypeId

UUID v7

string | null format: uuid
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f
weightKg
number | null
<= 5000
volumeLitres
integer | null
<= 100000
notes
string | null
<= 2000 characters
archived
boolean

Updated

Media typeapplication/json
object
id
required

UUID v7

string format: uuid
name
required
string
shortCode
required
string | null
sku
required
string | null
unitPrice
required

Pence, excluding VAT.

integer
<= 100000000
vatRate
required

VAT in basis points: 2000 is 20%, 500 is 5%, 0 is zero rated.

integer
<= 10000
charge
required
string | null
Allowed values: deposit hire
chargePeriod
required
string | null
Allowed values: once daily weekly monthly
chargeForProductId
required

UUID v7

string | null format: uuid
gasTypeId
required

UUID v7

string | null format: uuid
weightKg
required
number | null
volumeLitres
required
integer | null
notes
required
string | null
links
required
Array<object>
object
source
required
string
Allowed values: woocommerce shopify
externalId
required
string
externalVariantId
required
string | null
externalSku
required
string | null
lastSyncedAt
required
string | null format: date-time
archivedAt
required
string | null format: date-time
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
Example
{
"id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f",
"name": "19kg propane",
"shortCode": "19",
"sku": "PROP-19",
"unitPrice": 5400,
"vatRate": 2000,
"charge": "deposit",
"chargePeriod": "once",
"chargeForProductId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f",
"gasTypeId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f",
"weightKg": 38.5,
"volumeLitres": 60,
"links": [
{
"source": "woocommerce",
"externalId": "1043"
}
]
}

Not signed in

Media typeapplication/json
object
error
required
string
message
required
string
Example
{
"error": "not_found",
"message": "Customer not found"
}

Not a member, or without the permission this needs

Media typeapplication/json
object
error
required
string
message
required
string
Example
{
"error": "not_found",
"message": "Customer not found"
}

Not found

Media typeapplication/json
object
error
required
string
message
required
string
Example
{
"error": "not_found",
"message": "Customer not found"
}

Validation failed

Media typeapplication/json
object
error
required
string
Allowed values: validation
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string
Example
{
"error": "validation",
"issues": [
{
"path": "email",
"message": "Invalid email"
}
]
}