/v1/facilities/{facility_id}/retail-sales/quoteAuthentication
Bearer API key or Facily session, subject to permissions and facility scope.
Authentication and scopeRequest example
Replace bracketed path values with real IDs from your environment. The body, where shown, is generated from the schema and uses illustrative values.
curl --request POST \
--url 'https://api.staging.facily.ai/v1/facilities/<FACILITY_ID>/retail-sales/quote' \
--header "Authorization: Bearer $FACILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"lines": [
{
"item_id": "00000000-0000-4000-8000-000000000001",
"quantity": 1,
"discount_amount": "0.00"
}
],
"lease_id": "00000000-0000-4000-8000-000000000001"
}'Parameters
facility_idpath · stringrequiredFormat: uuid
Request body
application/json · Required
lease_idstring | nullThe tenant's lease, for their tax exemption; null for a walk-in.
Format: uuid
Show lease_id schema
string | nullThe tenant's lease, for their tax exemption; null for a walk-in.
Variant 1: string
stringVariant 2: null
nulllinesSaleLineRequest[]requiredThe items and quantities. At least one.
Min items: 1
Show lines schema
discount_amountnumber | stringDollars taken off the line at the till, at most its quantity times the unit price; tax is on what is left. Needs retail.discount.
Default: "0.00" · Minimum: 0 · Pattern: ^(?!^[-+.]*$)[+-]?0*(?:\d{0,8}|(?=[\d.]{1,11}0*$)\d{0,8}\.\d{0,2}0*$)
Show discount_amount schema
number | stringDollars taken off the line at the till, at most its quantity times the unit price; tax is on what is left. Needs retail.discount.
Variant 1: number
numberVariant 2: string
stringitem_idstringrequiredThe catalog item sold.
Format: uuid
quantityintegerrequiredUnits sold. Lines naming the same item are added together.
Minimum: 1
Responses
Expand a status to inspect its schema. Generated examples show structure and synthetic values.
200Successful Response
{
"data": {
"discount_amount": "<VALUE_MATCHING_PATTERN>",
"lines": [
{
"discount_amount": "<VALUE_MATCHING_PATTERN>",
"item_id": "00000000-0000-4000-8000-000000000001",
"quantity": 0,
"subtotal": "<VALUE_MATCHING_PATTERN>",
"tax_amount": "<VALUE_MATCHING_PATTERN>",
"total": "<VALUE_MATCHING_PATTERN>",
"unit_price": "<VALUE_MATCHING_PATTERN>"
}
],
"subtotal": "<VALUE_MATCHING_PATTERN>",
"tax_amount": "<VALUE_MATCHING_PATTERN>",
"total": "<VALUE_MATCHING_PATTERN>"
},
"meta": {
"request_id": "string"
}
}application/json
dataSaleQuoteResponserequiredShow data schema
discount_amountstringrequiredThe lines' discounts added up.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
linesQuotedLineResponse[]requiredOne line per item.
Show lines schema
discount_amountstringrequiredTaken off the line at the till; 0.00 when none.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
item_idstringrequiredThe catalog item.
Format: uuid
quantityintegerrequiredUnits.
subtotalstringrequiredQuantity times the unit price.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
tax_amountstringrequiredTax on the line after its discount; 0.00 when untaxed.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
totalstringrequiredSubtotal less the discount, plus tax.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
unit_pricestringrequiredThe price of one unit at this facility.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
subtotalstringrequiredThe lines' subtotals added up.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
tax_amountstringrequiredThe lines' tax added up.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
totalstringrequiredWhat the sale would charge now. Send it back as expected_total.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
metaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired400Validation error
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired401Unauthenticated
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired403Permission denied
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired404Not found
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired409Business logic error
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired503Temporary failure
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired