curl --request POST \
--url https://api.exowpee.com/v1/order/orders/{order}/confirm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"exchange_rates": "<string>",
"payments": [
{
"value": 123,
"currency_code": "<string>",
"currency_exponent": 9,
"register_payment_method_id": "<string>",
"actual_fee_amount": 1,
"cheque": {
"series": "<string>",
"number": "<string>",
"issuing_bank_name": "<string>",
"issuing_bank_code": "<string>",
"drawer_name": "<string>",
"drawer_account_reference": "<string>",
"issue_date": "2023-11-07T05:31:56Z",
"due_date": "2023-11-07T05:31:56Z"
}
}
]
}
'import requests
url = "https://api.exowpee.com/v1/order/orders/{order}/confirm"
payload = {
"exchange_rates": "<string>",
"payments": [
{
"value": 123,
"currency_code": "<string>",
"currency_exponent": 9,
"register_payment_method_id": "<string>",
"actual_fee_amount": 1,
"cheque": {
"series": "<string>",
"number": "<string>",
"issuing_bank_name": "<string>",
"issuing_bank_code": "<string>",
"drawer_name": "<string>",
"drawer_account_reference": "<string>",
"issue_date": "2023-11-07T05:31:56Z",
"due_date": "2023-11-07T05:31:56Z"
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
exchange_rates: '<string>',
payments: [
{
value: 123,
currency_code: '<string>',
currency_exponent: 9,
register_payment_method_id: '<string>',
actual_fee_amount: 1,
cheque: {
series: '<string>',
number: '<string>',
issuing_bank_name: '<string>',
issuing_bank_code: '<string>',
drawer_name: '<string>',
drawer_account_reference: '<string>',
issue_date: '2023-11-07T05:31:56Z',
due_date: '2023-11-07T05:31:56Z'
}
}
]
})
};
fetch('https://api.exowpee.com/v1/order/orders/{order}/confirm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/order/orders/{order}/confirm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'exchange_rates' => '<string>',
'payments' => [
[
'value' => 123,
'currency_code' => '<string>',
'currency_exponent' => 9,
'register_payment_method_id' => '<string>',
'actual_fee_amount' => 1,
'cheque' => [
'series' => '<string>',
'number' => '<string>',
'issuing_bank_name' => '<string>',
'issuing_bank_code' => '<string>',
'drawer_name' => '<string>',
'drawer_account_reference' => '<string>',
'issue_date' => '2023-11-07T05:31:56Z',
'due_date' => '2023-11-07T05:31:56Z'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/order/orders/{order}/confirm"
payload := strings.NewReader("{\n \"exchange_rates\": \"<string>\",\n \"payments\": [\n {\n \"value\": 123,\n \"currency_code\": \"<string>\",\n \"currency_exponent\": 9,\n \"register_payment_method_id\": \"<string>\",\n \"actual_fee_amount\": 1,\n \"cheque\": {\n \"series\": \"<string>\",\n \"number\": \"<string>\",\n \"issuing_bank_name\": \"<string>\",\n \"issuing_bank_code\": \"<string>\",\n \"drawer_name\": \"<string>\",\n \"drawer_account_reference\": \"<string>\",\n \"issue_date\": \"2023-11-07T05:31:56Z\",\n \"due_date\": \"2023-11-07T05:31:56Z\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/order/orders/{order}/confirm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"exchange_rates\": \"<string>\",\n \"payments\": [\n {\n \"value\": 123,\n \"currency_code\": \"<string>\",\n \"currency_exponent\": 9,\n \"register_payment_method_id\": \"<string>\",\n \"actual_fee_amount\": 1,\n \"cheque\": {\n \"series\": \"<string>\",\n \"number\": \"<string>\",\n \"issuing_bank_name\": \"<string>\",\n \"issuing_bank_code\": \"<string>\",\n \"drawer_name\": \"<string>\",\n \"drawer_account_reference\": \"<string>\",\n \"issue_date\": \"2023-11-07T05:31:56Z\",\n \"due_date\": \"2023-11-07T05:31:56Z\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/order/orders/{order}/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"exchange_rates\": \"<string>\",\n \"payments\": [\n {\n \"value\": 123,\n \"currency_code\": \"<string>\",\n \"currency_exponent\": 9,\n \"register_payment_method_id\": \"<string>\",\n \"actual_fee_amount\": 1,\n \"cheque\": {\n \"series\": \"<string>\",\n \"number\": \"<string>\",\n \"issuing_bank_name\": \"<string>\",\n \"issuing_bank_code\": \"<string>\",\n \"drawer_name\": \"<string>\",\n \"drawer_account_reference\": \"<string>\",\n \"issue_date\": \"2023-11-07T05:31:56Z\",\n \"due_date\": \"2023-11-07T05:31:56Z\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"number": 123,
"customer_id": "<string>",
"customer_name": "<string>",
"currency_code": "<string>",
"items_net_total": 123,
"items_tax_total": 123,
"items_gross_total": 123,
"discount": 123,
"charge": 123,
"order_tax_total": 123,
"total": 123,
"discount_applications": [
"<unknown>"
],
"status": "<string>",
"payment_status": "<string>",
"seller_id": "<string>",
"cash_register_id": "<string>",
"cashier_id": "<string>",
"confirmed_cashier_shift_id": "<string>",
"confirmed_cash_register_instance_id": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"rejected_at": "2023-11-07T05:31:56Z",
"approved_by": "<string>",
"rejected_by": "<string>",
"approved_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"tax_lines": "<array>",
"items": "<array>",
"payments": "<array>",
"seller": {},
"cash_register": {},
"cashier": {},
"is_credit": true,
"credit_detail": {},
"rendered_html": "<string>"
}{
"message": "<string>",
"errors": {}
}Confirm and cash a sale
A cashier finalizes an order by recording the payments received. Stock is taken out, accounting and customer credit are posted and an invoice snapshot is created.
curl --request POST \
--url https://api.exowpee.com/v1/order/orders/{order}/confirm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"exchange_rates": "<string>",
"payments": [
{
"value": 123,
"currency_code": "<string>",
"currency_exponent": 9,
"register_payment_method_id": "<string>",
"actual_fee_amount": 1,
"cheque": {
"series": "<string>",
"number": "<string>",
"issuing_bank_name": "<string>",
"issuing_bank_code": "<string>",
"drawer_name": "<string>",
"drawer_account_reference": "<string>",
"issue_date": "2023-11-07T05:31:56Z",
"due_date": "2023-11-07T05:31:56Z"
}
}
]
}
'import requests
url = "https://api.exowpee.com/v1/order/orders/{order}/confirm"
payload = {
"exchange_rates": "<string>",
"payments": [
{
"value": 123,
"currency_code": "<string>",
"currency_exponent": 9,
"register_payment_method_id": "<string>",
"actual_fee_amount": 1,
"cheque": {
"series": "<string>",
"number": "<string>",
"issuing_bank_name": "<string>",
"issuing_bank_code": "<string>",
"drawer_name": "<string>",
"drawer_account_reference": "<string>",
"issue_date": "2023-11-07T05:31:56Z",
"due_date": "2023-11-07T05:31:56Z"
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
exchange_rates: '<string>',
payments: [
{
value: 123,
currency_code: '<string>',
currency_exponent: 9,
register_payment_method_id: '<string>',
actual_fee_amount: 1,
cheque: {
series: '<string>',
number: '<string>',
issuing_bank_name: '<string>',
issuing_bank_code: '<string>',
drawer_name: '<string>',
drawer_account_reference: '<string>',
issue_date: '2023-11-07T05:31:56Z',
due_date: '2023-11-07T05:31:56Z'
}
}
]
})
};
fetch('https://api.exowpee.com/v1/order/orders/{order}/confirm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/order/orders/{order}/confirm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'exchange_rates' => '<string>',
'payments' => [
[
'value' => 123,
'currency_code' => '<string>',
'currency_exponent' => 9,
'register_payment_method_id' => '<string>',
'actual_fee_amount' => 1,
'cheque' => [
'series' => '<string>',
'number' => '<string>',
'issuing_bank_name' => '<string>',
'issuing_bank_code' => '<string>',
'drawer_name' => '<string>',
'drawer_account_reference' => '<string>',
'issue_date' => '2023-11-07T05:31:56Z',
'due_date' => '2023-11-07T05:31:56Z'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/order/orders/{order}/confirm"
payload := strings.NewReader("{\n \"exchange_rates\": \"<string>\",\n \"payments\": [\n {\n \"value\": 123,\n \"currency_code\": \"<string>\",\n \"currency_exponent\": 9,\n \"register_payment_method_id\": \"<string>\",\n \"actual_fee_amount\": 1,\n \"cheque\": {\n \"series\": \"<string>\",\n \"number\": \"<string>\",\n \"issuing_bank_name\": \"<string>\",\n \"issuing_bank_code\": \"<string>\",\n \"drawer_name\": \"<string>\",\n \"drawer_account_reference\": \"<string>\",\n \"issue_date\": \"2023-11-07T05:31:56Z\",\n \"due_date\": \"2023-11-07T05:31:56Z\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/order/orders/{order}/confirm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"exchange_rates\": \"<string>\",\n \"payments\": [\n {\n \"value\": 123,\n \"currency_code\": \"<string>\",\n \"currency_exponent\": 9,\n \"register_payment_method_id\": \"<string>\",\n \"actual_fee_amount\": 1,\n \"cheque\": {\n \"series\": \"<string>\",\n \"number\": \"<string>\",\n \"issuing_bank_name\": \"<string>\",\n \"issuing_bank_code\": \"<string>\",\n \"drawer_name\": \"<string>\",\n \"drawer_account_reference\": \"<string>\",\n \"issue_date\": \"2023-11-07T05:31:56Z\",\n \"due_date\": \"2023-11-07T05:31:56Z\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/order/orders/{order}/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"exchange_rates\": \"<string>\",\n \"payments\": [\n {\n \"value\": 123,\n \"currency_code\": \"<string>\",\n \"currency_exponent\": 9,\n \"register_payment_method_id\": \"<string>\",\n \"actual_fee_amount\": 1,\n \"cheque\": {\n \"series\": \"<string>\",\n \"number\": \"<string>\",\n \"issuing_bank_name\": \"<string>\",\n \"issuing_bank_code\": \"<string>\",\n \"drawer_name\": \"<string>\",\n \"drawer_account_reference\": \"<string>\",\n \"issue_date\": \"2023-11-07T05:31:56Z\",\n \"due_date\": \"2023-11-07T05:31:56Z\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"number": 123,
"customer_id": "<string>",
"customer_name": "<string>",
"currency_code": "<string>",
"items_net_total": 123,
"items_tax_total": 123,
"items_gross_total": 123,
"discount": 123,
"charge": 123,
"order_tax_total": 123,
"total": 123,
"discount_applications": [
"<unknown>"
],
"status": "<string>",
"payment_status": "<string>",
"seller_id": "<string>",
"cash_register_id": "<string>",
"cashier_id": "<string>",
"confirmed_cashier_shift_id": "<string>",
"confirmed_cash_register_instance_id": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"rejected_at": "2023-11-07T05:31:56Z",
"approved_by": "<string>",
"rejected_by": "<string>",
"approved_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"tax_lines": "<array>",
"items": "<array>",
"payments": "<array>",
"seller": {},
"cash_register": {},
"cashier": {},
"is_credit": true,
"credit_detail": {},
"rendered_html": "<string>"
}{
"message": "<string>",
"errors": {}
}- Only a connected cashier can confirm; the order’s register, when it has one, must be the cashier’s register.
- The order must be pending or approved (an order awaiting approval cannot be confirmed), and must be editable: created today unless the caller holds the update-past-data permission.
- The order must still be priced as stored: it is re-validated (prices, discounts, stock items) and refused if it needs repricing.
- The cashier must have an open register session on their register. When payments are sent, the cashier must be active on that register and the register must be unlocked.
- Each payment must use a payment method configured on the cashier’s register, that supports incoming money and is not of type other; exchange_rates is not accepted.
- A cheque payment needs a named customer on the order and cheque series, number, issuing bank name, drawer name and issue date; cheque details are refused for other methods. due_date cannot be before issue_date.
- A value cannot have more decimals than its currency_exponent.
- The payments must not exceed the order total.
- Unless the order is a credit sale with a named customer, the payments must equal the order total.
- For a credit sale the customer must exist and be allowed credit; credit_limit rules are applied (maximum balance, maximum credit amount, overdue orders). A sale needing approval is refused unless the order was approved first.
- Takes the items out of stock from the locations chosen in the item allocations, and keeps each withdrawal with its cost so a cancellation can put it back; the cost of goods sold of each item is stored.
- Records one payment row per payment received, converting foreign-currency payments to the company currency.
- Posts the sale in accounting (revenue, taxes and cost of goods sold by stock location), and recognizes the received payments on the money accounts or the register’s cash account.
- For a credit sale with an unpaid balance, records a customer debt in the books for the unpaid amount, from the company credit sales account to the customer’s debt account, and sets the credit detail amounts.
- Consumes the usage of the discount campaigns and codes applied to the order.
- Sets the status to completed, the payment status (unpaid, partially_paid or paid), the register, cashier, register session and device, and completed_at.
- Creates the invoice snapshot and returns the rendered invoice in rendered_html.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the order.
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource Comma-separated JSON keys of the root resource (id is always rendered). Available: id, number, customer_id, customer_name, currency_code, items_net_total, items_tax_total, items_gross_total, discount, charge, order_tax_total, total, discount_applications, status, payment_status, seller_id, cash_register_id, cashier_id, confirmed_cashier_shift_id, confirmed_cash_register_instance_id, completed_at, cancelled_at, rejected_at, approved_by, rejected_by, approved_at, created_at, updated_at, is_credit, credit_detail, rendered_html.
Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: items, items.taxLines, items.allocations, taxLines, payments, seller, cashRegister, cashier.
Body
Not accepted: conversion rates come from the accounting settings, not from the request.
Payments received for the sale, at least one when sent. May be omitted only for a credit sale with a named customer, which then stays fully on credit. The total cannot exceed the order total.
1Show child attributes
Show child attributes
Response
Resource (only with response=resource).
Identifier of the order (27-character KSUID string).
Sequential order number inside the company, allocated by the server at creation (last number plus one).
Identifier of the customer, or null for an anonymous sale.
Customer name kept on the order: copied from the stored customer when customer_id is set, otherwise the free text sent.
ISO 4217 currency code of the order, copied from the company settings.
Sum of the lines before tax, after discounts, in major units of currency_code (stored in minor units and divided by 10 to the power of the currency exponent).
Sum of the taxes of the lines, in major units of currency_code.
items_net_total plus items_tax_total, in major units of currency_code.
Total discount applied to the order, in major units of currency_code.
Extra charge added to the order, in major units of currency_code. The server currently always computes 0.
Taxes applied on the whole order rather than on lines, in major units of currency_code.
Amount to pay: items_gross_total plus order_tax_total plus charge, in major units of currency_code.
Discounts applied to the order, one entry per campaign, code or manual discount, with amounts in major units and the allocation to each item. On create and update it is the computed breakdown (ttc_saving filled); on later reads it is the stored record (ttc_saving is null). Null when none is available.
Life-cycle status: pending (waiting for payment), awaiting_approval, approved, unapproved, updating (opened for changes), rejected, completed (cashed) or cancelled. Set by the server.
unpaid, partially_paid or paid. Set by the server at confirmation from the payments received against the total; unpaid before.
Identifier of the seller record that created the order.
Identifier of the register of the order: at creation, the seller's register, or for a direct seller the register sent in the request; once confirmed, the cashier's register. Null for a direct seller who sent no register, until confirmation.
Identifier of the cashier record that confirmed the sale. Null until confirmation.
Identifier of the register session in which the sale was confirmed. Null until confirmation.
Identifier of the cash register computer used by the register session when the sale was confirmed. Null until confirmation.
Time of confirmation, ISO 8601. Null until confirmed.
Time of cancellation, ISO 8601. Null unless cancelled.
Time the cashier rejected the order, ISO 8601. Cleared when the order returns to pending.
Identifier of the agent account or user profile who approved the order. Null when not approved.
Reserved: the reject action does not fill it, so it is normally null.
Time of approval, ISO 8601. Null when not approved or after the approval was withdrawn.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).
Taxes applied at order level (not on a line). Only present when requested with include.
Lines of the order. Only present when requested with include.
Payments recorded when the sale was confirmed. Empty until then. Only present when requested with include.
Summary of the seller record. Only present when requested with include.
Summary of the register. Only present when requested with include.
Summary of the cashier who confirmed the sale. Only present when requested with include.
True for a credit sale, where the customer may leave part or all of the total unpaid and owes it as a debt. A credit sale needs a customer.
Credit sale detail: id, total_amount, remaining_amount, paid_amount (major units), due_date and ask_approval. Null for a cash sale or when the detail is missing. total_amount is set when the order is saved; remaining_amount stays 0 until confirmation, which sets it to the unpaid part.
Invoice rendered at confirmation as HTML. Present only in the response of the confirm action.