Cash Register Hooks
In-store cash register integration hook endpoints
Returns the full pre-order data for an order number that was previously generated by the get_order_number endpoint.
How It Works:
Validates the request credentials.
Looks up the pre-order session using the provided order number from cache.
Verifies that the payment option is set and is of cash register type.
Verifies the basket has not changed since the pre-order was created.
Returns the full pre-order details including basket, addresses, shipping, and payment data.
Installment Support: When installment payments are enabled for the cash register integration and an installment plan is selected on the pre-order, an additional card object is included in the response with details about the selected card and issuing bank.
Authentication: Credentials are validated against the CASH_REGISTER_AUTH_CONF dynamic setting (configurable via Admin Panel → Dynamic Settings).
Error Handling: On failure, the response contains error_code and error_message. HTTP status is always 200.
"402"
Basket has changed since the pre-order was created
"403"
Invalid credentials
"407"
No payment option set on the pre-order
"408"
Payment option is not of cash register type
"409"
Order number is missing from the request
"410"
Order number not found in the active pre-order cache
"411"
Pre-order session not found
Order number previously generated by the get_order_number endpoint.
ORD-2024-001234Integration username for authenticating the cash register request.
cashier01Integration password for authenticating the cash register request.
secretPre-order details on success, or an error response if validation fails.
Check for the presence of error_code to determine if the request succeeded.
On success, contains order_number and pre_order (plus optional card).
On failure, contains error_code and error_message.
The order number from the request. Present on success only.
ORD-2024-001234Error code when the request fails. Not present on success.
403Human-readable error description. Not present on success.
User invalidPOST /hooks/cash_register/pre_order/ HTTP/1.1
Host: sandbox.akinon.com
Content-Type: application/json
Accept: */*
Content-Length: 77
{
"order_number": "ORD-2024-001234",
"username": "cashier01",
"password": "secret"
}Pre-order details on success, or an error response if validation fails.
Check for the presence of error_code to determine if the request succeeded.
{
"order_number": "ORD-2024-001234",
"pre_order": {
"basket": {
"pk": 5001,
"total_amount": "299.99"
},
"shipping_address": {
"pk": 101,
"title": "Home",
"first_name": "John",
"last_name": "Doe",
"line": "123 Main St"
},
"billing_address": {
"pk": 101,
"title": "Home"
},
"payment_option": {
"pk": 3,
"payment_type": "cash_register"
},
"shipping_amount": "9.99",
"total_amount": "309.98",
"unpaid_amount": "309.98",
"currency_type_label": "Turkish Lira"
}
}Generates a unique order number for the active basket and registers it in the pre-order session cache for subsequent cash register payment steps.
How It Works:
Generates a unique order number.
Retrieves the pre-order session linked to the current basket.
Validates that a cash register payment option is selected on the pre-order.
Stores the order number to pre-order mapping in cache (valid for 24 hours).
Returns the generated order number for use in the
pre_orderandcompletesteps.
Error Handling: On error, an error_code field is included in the response alongside error_message. The HTTP status code is always 200 — check for the presence of error_code to detect failures.
"407"
No payment option is set on the pre-order
"408"
Payment option is not of cash register type
Order number generated and cached, or an error if the pre-order state is invalid.
Check for the presence of error_code to determine if the request succeeded.
Response from the order number generation endpoint.
On success, only order_number is present.
On failure, error_code and error_message are present; order_number may or may not be included.
Generated unique order number. Present on success and on error_code 408.
ORD-2024-001234Error code when the pre-order state is invalid.
"407": No payment option set."408": Payment option is not cash register type.
407Human-readable error description. Only present on failure.
PaymentOption is nullGET /hooks/cash_register/get_order_number/ HTTP/1.1
Host: sandbox.akinon.com
Accept: */*
Order number generated and cached, or an error if the pre-order state is invalid.
Check for the presence of error_code to determine if the request succeeded.
{
"order_number": "ORD-2024-001234"
}Finalizes a cash register payment and schedules order creation.
How It Works:
Validates the request credentials and order number.
Retrieves the pre-order session associated with the order number.
Verifies that the selected payment option is of cash register type.
Optionally applies promotions to the basket before calculating the amount.
Confirms the submitted amount matches the outstanding balance on the pre-order.
Verifies the basket has not changed since the pre-order was created.
Records the transaction and schedules order completion in the background.
Promotions: If promotions is provided, discounts are applied to the basket and the discounted_amount field is used for balance validation instead of amount.
Authentication: The username and password fields are validated against the CASH_REGISTER_AUTH_CONF dynamic setting (configurable via Admin Panel → Dynamic Settings).
Result Codes:
"0"
Payment accepted, order creation scheduled
402
Invalid request payload or basket has changed since pre-order
403
Invalid credentials
404
Order number not found in the active pre-order cache
405
Submitted amount does not match the outstanding balance
407
No payment option is set on the pre-order
408
Payment option is not of cash register type
411
Pre-order session not found
412
Error occurred while applying offer:
Note: This endpoint always returns HTTP 200. Both success and failure responses share the same structure — use the result field to distinguish them.
Unique transaction identifier assigned by the cash register terminal.
TXN-20240615-001The order number associated with the active pre-order session.
ORD-2024-001234Integration username for authenticating the cash register request.
cashier01Integration password for authenticating the cash register request.
secretTotal amount to be paid. Must match the outstanding balance on the pre-order.
Used for validation unless promotions are provided, in which case
discounted_amount is used instead.
299.99Discounted total after promotions are applied. Required when promotions is provided.
Used for balance validation instead of amount.
249.99Identifier of the cash register terminal. Optional.
TERM-001Response for both successful and failed transactions.
Check the result field: "0" indicates success; any other value is an error code.
Returned for both successful and failed cash register payment completions.
The result field indicates the outcome.
Transaction identifier from the request. null on failure.
TXN-20240615-001Order number from the request. null when the order was not resolved.
ORD-2024-001234"0" on success. Integer error code on failure:
402 (invalid input or basket changed), 403 (invalid credentials),
404 (order not found), 405 (amount mismatch), 407 (payment option not set),
408 (wrong payment option type), 411 (pre-order not found), 412 (offer application error).
0Human-readable error description. Empty string on success.
Confirmed payment amount. null on failure.
299.99Staff member identifier from the pre-order. null on failure.
232Email of the staff member associated with the pre-order. null on failure.
staff@example.comStore identifier from the pre-order. null on failure.
123SKU of the configured shipping product for cash register payments.
null if not configured or on failure.
SHIP-SKU-001POST /hooks/cash_register/complete/ HTTP/1.1
Host: sandbox.akinon.com
Content-Type: application/json
Accept: */*
Content-Length: 158
{
"transaction_id": "TXN-20240615-001",
"order_number": "ORD-2024-001234",
"username": "cashier01",
"password": "secret",
"amount": "299.99",
"terminal_code": "TERM-001"
}Response for both successful and failed transactions.
Check the result field: "0" indicates success; any other value is an error code.
{
"transaction_id": "TXN-20240615-001",
"order_number": "ORD-2024-001234",
"result": "0",
"error_message": "",
"amount": "299.99",
"staff_id": 232,
"staff_email": "staff@example.com",
"store_id": "123",
"shipping_sku": "SHIP-SKU-001"
}Last updated
Was this helpful?

