Put customers on a price list
POST
/customers/rate-set
const url = 'https://example.com/customers/rate-set';const options = { method: 'POST', headers: { cookie: 'bottle.session_token=<bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"customerIds":["019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f"],"rateSetId":"019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f","clearAgreedRates":false,"dryRun":false}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/customers/rate-set \ --header 'Content-Type: application/json' \ --cookie bottle.session_token=<bottle.session_token> \ --data '{ "customerIds": [ "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" ], "rateSetId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "clearAgreedRates": false, "dryRun": false }'Many customers at once, onto a price list or (rateSetId null) off theirs. A customer is on one list or none. dryRun only counts. clearAgreedRates removes the moved customers’ own agreed prices on products the list prices, which would otherwise still beat it. All or nothing: an unknown customer or list is 404, an archived list 409.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
customerIds
required
Array<string>
rateSetId
required
UUID v7
string | null format: uuid
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fclearAgreedRates
boolean
dryRun
boolean
Responses
Section titled “Responses”Moved, or what would move
Media typeapplication/json
object
moved
required
integer
unchanged
required
integer
agreedRatesInTheWay
required
integer
agreedRatesCleared
required
integer
Examplegenerated
{ "moved": 1, "unchanged": 1, "agreedRatesInTheWay": 1, "agreedRatesCleared": 1}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"}A customer or the list is not this business’s
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}The list is archived
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
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}