Skip to content

Take a cash sale

POST
/api/v1/commerce/pos/sales/cash
curl --request POST \
--url https://digize.com/api/v1/commerce/pos/sales/cash \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \
--header 'x-api-key: <x-api-key>' \
--data '{ "locationId": "example", "lines": [ { "variantId": "example", "quantity": 1 } ], "discount": { "kind": "percent", "value": 1, "label": "example" }, "email": "example", "phone": "example", "name": "example", "note": "example", "expectedTotal": 1, "tendered": 1 }'

Rings up a sale paid in cash: prices it from the catalog with the store’s tax, takes the stock from the register’s location and records the order on the point of sale channel. tendered is the cash handed over.

Needs the commerce:write permission. It can’t be undone.

Idempotency-Key
string
>= 1 characters <= 255 characters

Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.

Example

5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69
Media typeapplication/json
object
locationId
required
string
>= 1 characters <= 64 characters
lines
required
Array<object>
>= 1 items <= 100 items
object
variantId
required
string
>= 1 characters <= 64 characters
quantity
required
integer
>= 1 <= 999
discount
Any of:
object
kind
required
string
Allowed values: percent amount
value
required
integer
<= 9007199254740991
label
Any of:
string
<= 60 characters
email
Any of:
string
<= 254 characters
phone
Any of:
string
<= 40 characters
name
Any of:
string
<= 120 characters
note
Any of:
string
<= 500 characters
expectedTotal
required

The total the register showed, in minor units: a price that changed since is refused.

integer
<= 9007199254740991
tendered
Any of:
integer
<= 9007199254740991

Done

Media typeapplication/json
object
id
required
string
status
required
string
Allowed values: pending paid cancelled
method
required
string
Allowed values: cash card
locationId
required
string
locationName
required
string
lines
required
Array<object>
object
name
required
string
variant
required
string
quantity
required
number
price
required
number
totals
required
object
subtotal
required
number
discount
required
number
discountLabel
required
string | null
tax
required
number
taxName
required
string
taxIncluded
required
boolean
total
required
number
currency
required
string
email
required
string | null
phone
required
string | null
name
required
string | null
tendered
required
number | null
change
required
number | null
card
required

The card Stripe read: “Visa •••• 4242”.

string | null
paymentIntentId
required
string | null
orderId
required
string | null
orderNumber
required
number | null
receiptTo
required
string | null
receiptAt
required
Any of:
string format: date-time
error
required
string | null
actorName
required
string
createdAt
required
string format: date-time
completedAt
required
Any of:
string format: date-time

Example

{
"status": "pending",
"method": "cash"
}

What was sent isn’t valid (invalid).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

No key, or one that’s unknown, off or expired.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The key doesn’t have the permission this needs.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Nothing has that id (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

A request with the same Idempotency-Key is still running (conflict).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The Idempotency-Key was used with a different request.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Over the rate limit; see retry-after.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}