Skip to content
FacilydevelopersDashboard
Build with Facily
DocsREST APIsCreate Retail Sale
Search the full API reference Esc to close

Create Retail Sale

Retail · REST API reference

Get support
POST/v1/facilities/{facility_id}/retail-sales
Sell to a tenant (one charge per item on the lease's ledger) or to a walk-in (the charges and the payment on the facility's counter ledger; this also needs payment.process). A recorded tender or a keyed card answers 201 with the sale completed (or failed, for a declined card); a reader usually answers 202 with the sale pending: poll its payment_id. A repeated Idempotency-Key with the same lines returns the first sale; with different lines it is a 409.

Authentication

Bearer API key or Facily session, subject to permissions and facility scope.

Authentication and scope

Request 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
curl --request POST \
  --url 'https://api.staging.facily.ai/v1/facilities/<FACILITY_ID>/retail-sales' \
  --header "Authorization: Bearer $FACILY_API_KEY" \
  --header 'Idempotency-Key: <IDEMPOTENCY_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
  "expected_total": 0,
  "lines": [
    {
      "item_id": "00000000-0000-4000-8000-000000000001",
      "quantity": 1,
      "discount_amount": "0.00"
    }
  ],
  "payer": {
    "kind": "string",
    "lease_id": "00000000-0000-4000-8000-000000000001"
  }
}'
An example for building your request, not an executed call. Check required fields, allowed values, and environment configuration before sending.

Parameters

facility_idpath · stringrequired

Format: uuid

Idempotency-Keyheader · stringrequired

Min length: 1 · Max length: 100

Request body

application/json · Required

expected_totalnumber | stringrequired

The total the caller showed, from the quote. A different total now is refused.

Minimum: 0 · Pattern: ^(?!^[-+.]*$)[+-]?0*(?:\d{0,10}|(?=[\d.]{1,13}0*$)\d{0,10}\.\d{0,2}0*$)

Show expected_total schema
number | string

The total the caller showed, from the quote. A different total now is refused.

Variant 1: number
number
Variant 2: string
string
linesSaleLineRequest[]required

The items and quantities. At least one.

Min items: 1

Show lines schema
discount_amountnumber | string

Dollars 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 | string

Dollars 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
number
Variant 2: string
string
item_idstringrequired

The catalog item sold.

Format: uuid

quantityintegerrequired

Units sold. Lines naming the same item are added together.

Minimum: 1

payerTenantPayerRequest | WalkInPayerRequestrequired

Who pays: a tenant on their lease's ledger, or a walk-in paying now on the counter.

Show payer schema
TenantPayerRequest | WalkInPayerRequest

Who pays: a tenant on their lease's ledger, or a walk-in paying now on the counter.

Variant 1: TenantPayerRequest
kindstringrequired

A tenant: the sale is charged to the lease's ledger.

lease_idstringrequired

The active lease the charge posts to.

Format: uuid

Variant 2: WalkInPayerRequest
expected_surcharge_amountnumber | string | null

Keyed card only: the surcharge the operator was shown. A different quote now is refused.

Minimum: 0 · Pattern: ^(?!^[-+.]*$)[+-]?0*(?:\d{0,10}|(?=[\d.]{1,13}0*$)\d{0,10}\.\d{0,2}0*$)

Show expected_surcharge_amount schema
number | string | null

Keyed card only: the surcharge the operator was shown. A different quote now is refused.

Variant 1: number
number
Variant 2: string
string
Variant 3: null
null
external_referencestring | null

A card run elsewhere: its reference. A check or money order: its number (required). Refused for cash. The rules are the payments route's.

Max length: 255

Show external_reference schema
string | null

A card run elsewhere: its reference. A check or money order: its number (required). Refused for cash. The rules are the payments route's.

Variant 1: string
string
Variant 2: null
null
kindstringrequired

Someone who is not a tenant, paying at the counter.

payment_method_idstring | null

Card only: a one-time card vaulted for this sale (POST .../one-time-cards), charged now.

Format: uuid

Show payment_method_id schema
string | null

Card only: a one-time card vaulted for this sale (POST .../one-time-cards), charged now.

Variant 1: string
string
Variant 2: null
null
tenderstringrequired

How the walk-in pays. A card names exactly one of payment_method_id, terminal_id or external_reference.

Values: "cash", "card", "check", "money_order"

terminal_idstring | null

Card only: the reader that takes the card.

Format: uuid

Show terminal_id schema
string | null

Card only: the reader that takes the card.

Variant 1: string
string
Variant 2: null
null

Responses

Expand a status to inspect its schema. Generated examples show structure and synthetic values.

201Successful Response
JSON · generated example
{
  "data": {
    "can_void": false,
    "created_at": "2026-10-29T12:00:00Z",
    "discount_amount": "<VALUE_MATCHING_PATTERN>",
    "facility_id": "00000000-0000-4000-8000-000000000001",
    "id": "00000000-0000-4000-8000-000000000001",
    "lines": [
      {
        "discount_amount": "<VALUE_MATCHING_PATTERN>",
        "item_id": "00000000-0000-4000-8000-000000000001",
        "name": "string",
        "quantity": 0,
        "sku": "string",
        "subtotal": "<VALUE_MATCHING_PATTERN>",
        "tax_amount": "<VALUE_MATCHING_PATTERN>",
        "total": "<VALUE_MATCHING_PATTERN>",
        "unit_price": "<VALUE_MATCHING_PATTERN>"
      }
    ],
    "payer_kind": "string",
    "payment_id": "00000000-0000-4000-8000-000000000001",
    "sold_on": "2026-10-29",
    "staff_name": "string",
    "status": "string",
    "subtotal": "<VALUE_MATCHING_PATTERN>",
    "tax_amount": "<VALUE_MATCHING_PATTERN>",
    "tenant": {
      "id": "00000000-0000-4000-8000-000000000001",
      "name": "string"
    },
    "tender": {
      "last_four": "string",
      "method": "string",
      "reference": "string"
    },
    "total": "<VALUE_MATCHING_PATTERN>",
    "unit_numbers": [
      "string"
    ],
    "void_blocked_reason": "string"
  },
  "meta": {
    "request_id": "string"
  }
}

application/json

dataSaleResponserequired
Show data schema
can_voidbooleanrequired

Whether this caller can void the sale now: holds the permissions for its payer kind, the sale is completed, and the facility's void window is open.

created_atstringrequired

When the sale was made.

Format: date-time

discount_amountstringrequired

The lines' discounts added up.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

facility_idstringrequired

The facility that made the sale.

Format: uuid

idstringrequired

Unique identifier for this sale.

Format: uuid

linesSaleListLineResponse[]required

One line per item.

Show lines schema
discount_amountstringrequired

Taken off the line at the till; 0.00 when none.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

item_idstringrequired

The catalog item.

Format: uuid

namestringrequired

The item's name.

quantityintegerrequired

Units sold.

skustringrequired

The item's SKU.

subtotalstringrequired

Quantity times the unit price.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

tax_amountstringrequired

Tax on the line after its discount; 0.00 when untaxed.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

totalstringrequired

Subtotal less the discount, plus tax.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

unit_pricestringrequired

The price of one unit when sold.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

payer_kindstringrequired

tenant or walk_in.

payment_idstring | nullrequired

The walk-in's payment.

Format: uuid

Show payment_id schema
string | null

The walk-in's payment.

Variant 1: string
string
Variant 2: null
null
sold_onstringrequired

The facility's business date of the sale.

Format: date

staff_namestring | nullrequired

Who made the sale.

Show staff_name schema
string | null

Who made the sale.

Variant 1: string
string
Variant 2: null
null
statusstringrequired

completed, void_pending or voided.

subtotalstringrequired

The lines' subtotals added up.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

tax_amountstringrequired

The lines' tax added up.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

tenantSaleTenantResponse | nullrequired

The tenant, for a tenant sale; null for a walk-in.

Show tenant schema
SaleTenantResponse | null

The tenant, for a tenant sale; null for a walk-in.

Variant 1: SaleTenantResponse
idstringrequired

The tenant.

Format: uuid

namestringrequired

The tenant's name as staff see it.

Variant 2: null
null
tenderSaleTenderResponse | nullrequired

How a walk-in paid; null for a tenant sale.

Show tender schema
SaleTenderResponse | null

How a walk-in paid; null for a tenant sale.

Variant 1: SaleTenderResponse
last_fourstring | nullrequired

A card's last four digits, when the sale kept the card.

Show last_four schema
string | null

A card's last four digits, when the sale kept the card.

Variant 1: string
Variant 2: null
methodstringrequired

cash, check, money_order or card.

referencestring | nullrequired

A check or money order number, or a card's outside reference.

Show reference schema
string | null

A check or money order number, or a card's outside reference.

Variant 1: string
Variant 2: null
Variant 2: null
null
totalstringrequired

What the sale charged.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

unit_numbersstring[]required

The tenant's unit, for a tenant sale; empty for a walk-in.

Show unit_numbers schema
string
void_blocked_reasonstring | nullrequired

Why a completed sale cannot be voided: void_window_closed or lease_not_active; else null.

Show void_blocked_reason schema
string | null

Why a completed sale cannot be voided: void_window_closed or lease_not_active; else null.

Variant 1: string
string
Variant 2: null
null
metaMetarequired

Envelope metadata. Every response carries one.

Show meta schema
request_idstringrequired
202The card is at the processor: the sale is pending (or void_pending) until it decides
JSON · generated example
{
  "data": {
    "can_void": false,
    "created_at": "2026-10-29T12:00:00Z",
    "discount_amount": "<VALUE_MATCHING_PATTERN>",
    "facility_id": "00000000-0000-4000-8000-000000000001",
    "id": "00000000-0000-4000-8000-000000000001",
    "lines": [
      {
        "discount_amount": "<VALUE_MATCHING_PATTERN>",
        "item_id": "00000000-0000-4000-8000-000000000001",
        "name": "string",
        "quantity": 0,
        "sku": "string",
        "subtotal": "<VALUE_MATCHING_PATTERN>",
        "tax_amount": "<VALUE_MATCHING_PATTERN>",
        "total": "<VALUE_MATCHING_PATTERN>",
        "unit_price": "<VALUE_MATCHING_PATTERN>"
      }
    ],
    "payer_kind": "string",
    "payment_id": "00000000-0000-4000-8000-000000000001",
    "sold_on": "2026-10-29",
    "staff_name": "string",
    "status": "string",
    "subtotal": "<VALUE_MATCHING_PATTERN>",
    "tax_amount": "<VALUE_MATCHING_PATTERN>",
    "tenant": {
      "id": "00000000-0000-4000-8000-000000000001",
      "name": "string"
    },
    "tender": {
      "last_four": "string",
      "method": "string",
      "reference": "string"
    },
    "total": "<VALUE_MATCHING_PATTERN>",
    "unit_numbers": [
      "string"
    ],
    "void_blocked_reason": "string"
  },
  "meta": {
    "request_id": "string"
  }
}

application/json

dataSaleResponserequired
Show data schema
can_voidbooleanrequired

Whether this caller can void the sale now: holds the permissions for its payer kind, the sale is completed, and the facility's void window is open.

created_atstringrequired

When the sale was made.

Format: date-time

discount_amountstringrequired

The lines' discounts added up.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

facility_idstringrequired

The facility that made the sale.

Format: uuid

idstringrequired

Unique identifier for this sale.

Format: uuid

linesSaleListLineResponse[]required

One line per item.

Show lines schema
discount_amountstringrequired

Taken off the line at the till; 0.00 when none.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

item_idstringrequired

The catalog item.

Format: uuid

namestringrequired

The item's name.

quantityintegerrequired

Units sold.

skustringrequired

The item's SKU.

subtotalstringrequired

Quantity times the unit price.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

tax_amountstringrequired

Tax on the line after its discount; 0.00 when untaxed.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

totalstringrequired

Subtotal less the discount, plus tax.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

unit_pricestringrequired

The price of one unit when sold.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

payer_kindstringrequired

tenant or walk_in.

payment_idstring | nullrequired

The walk-in's payment.

Format: uuid

Show payment_id schema
string | null

The walk-in's payment.

Variant 1: string
string
Variant 2: null
null
sold_onstringrequired

The facility's business date of the sale.

Format: date

staff_namestring | nullrequired

Who made the sale.

Show staff_name schema
string | null

Who made the sale.

Variant 1: string
string
Variant 2: null
null
statusstringrequired

completed, void_pending or voided.

subtotalstringrequired

The lines' subtotals added up.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

tax_amountstringrequired

The lines' tax added up.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

tenantSaleTenantResponse | nullrequired

The tenant, for a tenant sale; null for a walk-in.

Show tenant schema
SaleTenantResponse | null

The tenant, for a tenant sale; null for a walk-in.

Variant 1: SaleTenantResponse
idstringrequired

The tenant.

Format: uuid

namestringrequired

The tenant's name as staff see it.

Variant 2: null
null
tenderSaleTenderResponse | nullrequired

How a walk-in paid; null for a tenant sale.

Show tender schema
SaleTenderResponse | null

How a walk-in paid; null for a tenant sale.

Variant 1: SaleTenderResponse
last_fourstring | nullrequired

A card's last four digits, when the sale kept the card.

Show last_four schema
string | null

A card's last four digits, when the sale kept the card.

Variant 1: string
Variant 2: null
methodstringrequired

cash, check, money_order or card.

referencestring | nullrequired

A check or money order number, or a card's outside reference.

Show reference schema
string | null

A check or money order number, or a card's outside reference.

Variant 1: string
Variant 2: null
Variant 2: null
null
totalstringrequired

What the sale charged.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

unit_numbersstring[]required

The tenant's unit, for a tenant sale; empty for a walk-in.

Show unit_numbers schema
string
void_blocked_reasonstring | nullrequired

Why a completed sale cannot be voided: void_window_closed or lease_not_active; else null.

Show void_blocked_reason schema
string | null

Why a completed sale cannot be voided: void_window_closed or lease_not_active; else null.

Variant 1: string
string
Variant 2: null
null
metaMetarequired

Envelope metadata. Every response carries one.

Show meta schema
request_idstringrequired
400Validation error
JSON · generated example
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "request_id": "string"
  }
}

application/json

errorErrorBodyrequired

The shape of error.* in an error response.

Show error schema
codestringrequired
detailsobject | null
Show details schema
object | null
Variant 1: object
object
Variant 2: null
null
messagestringrequired
metaMetarequired

Envelope metadata. Every response carries one.

Show meta schema
request_idstringrequired
401Unauthenticated
JSON · generated example
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "request_id": "string"
  }
}

application/json

errorErrorBodyrequired

The shape of error.* in an error response.

Show error schema
codestringrequired
detailsobject | null
Show details schema
object | null
Variant 1: object
object
Variant 2: null
null
messagestringrequired
metaMetarequired

Envelope metadata. Every response carries one.

Show meta schema
request_idstringrequired
403Permission denied
JSON · generated example
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "request_id": "string"
  }
}

application/json

errorErrorBodyrequired

The shape of error.* in an error response.

Show error schema
codestringrequired
detailsobject | null
Show details schema
object | null
Variant 1: object
object
Variant 2: null
null
messagestringrequired
metaMetarequired

Envelope metadata. Every response carries one.

Show meta schema
request_idstringrequired
404Not found
JSON · generated example
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "request_id": "string"
  }
}

application/json

errorErrorBodyrequired

The shape of error.* in an error response.

Show error schema
codestringrequired
detailsobject | null
Show details schema
object | null
Variant 1: object
object
Variant 2: null
null
messagestringrequired
metaMetarequired

Envelope metadata. Every response carries one.

Show meta schema
request_idstringrequired
409Business logic error
JSON · generated example
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "request_id": "string"
  }
}

application/json

errorErrorBodyrequired

The shape of error.* in an error response.

Show error schema
codestringrequired
detailsobject | null
Show details schema
object | null
Variant 1: object
object
Variant 2: null
null
messagestringrequired
metaMetarequired

Envelope metadata. Every response carries one.

Show meta schema
request_idstringrequired
503Temporary failure
JSON · generated example
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "request_id": "string"
  }
}

application/json

errorErrorBodyrequired

The shape of error.* in an error response.

Show error schema
codestringrequired
detailsobject | null
Show details schema
object | null
Variant 1: object
object
Variant 2: null
null
messagestringrequired
metaMetarequired

Envelope metadata. Every response carries one.

Show meta schema
request_idstringrequired
Continue exploringAll retail operations
Build something that works beautifully.

Facily API · Contract v1.200 · Reviewed October 29, 2026

Create Retail Sale | Facily Developers