Get the business surcharge rule
GET
/order-surcharge
const url = 'https://example.com/order-surcharge';const options = { method: 'GET', headers: {cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/order-surcharge \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token>Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Order surcharge settings
Media typeapplication/json
object
enabled
required
boolean
name
required
string
amountPence
required
integer
priceIncludesVat
required
boolean
appliesTo
string
chargeBy
string
customerRule
string
gasTypeIds
Array<string>
productIds
Array<string>
updatedAt
required
string format: date-time
Example
{ "appliesTo": "all_orders", "chargeBy": "per_order", "customerRule": "everyone", "gasTypeIds": [], "productIds": []}Not signed in
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Not permitted
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Invalid surcharge settings
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" } ]}