> For the complete documentation index, see [llms.txt](https://docs.flowretail.com/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowretail.com/api/ordersettlement.md).

# OrderSettlement

OrderSettlement

## List order settlements

> List all settlements for an order.\
> \
> Required permissions: SALES\_ORDER,RETURN\_ORDER

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"OrderSettlement","description":"OrderSettlement"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"parameters":{"pageNumberQuery":{"description":"Reference to a specific page in a result set.","in":"query","name":"pageNumber","required":false,"schema":{"type":"integer"}},"pageSizeQuery":{"description":"The number of items per page in a result set.","in":"query","name":"pageSize","required":false,"schema":{"type":"integer"}},"sortByQuery":{"description":"Defines which field the resource list is sorted by.","in":"query","name":"sortBy","required":false,"schema":{"type":"string"}},"sortDirectionQuery":{"description":"Reference to a sort direction","explode":false,"in":"query","name":"sortDirection","schema":{"$ref":"#/components/schemas/SortDirectionENUM"},"style":"form"}},"schemas":{"SortDirectionENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ASC | Sort in ascending order|\n| DESC | Sort in descending order|\n","enum":["ASC","DESC"],"title":"SortDirectionENUM","type":"string"},"SettlementResponseSchema":{"title":"SettlementResponseSchema","type":"object","required":["amount","createdAt","displayMessages","externalId","externalPaymentReference","idMethod","lastModifiedAt","parameters","settlementCode","settlementUid","settlementName","state","status","storeSettlementIssuer","tenantUserDisplayName","tenantUserUid","storePaymentMethodUid","currency","additionalDetails","creditCount","creditAmount","paymentCount","paymentAmount","storeUid","storeName","orderReceiptUid","transactions","receiptText"],"properties":{"amount":{"type":"integer"},"createdAt":{"format":"date-time","type":"string"},"displayMessages":{"type":"array","items":{"$ref":"#/components/schemas/SettlementDisplayMessageSchema"}},"externalId":{"type":"string"},"externalPaymentReference":{"type":"string","description":"The external payment reference for this settlement.\nFor invoices, this could contain the KID"},"idMethod":{"$ref":"#/components/schemas/SettlementIdMethodENUM"},"lastModifiedAt":{"format":"date-time","type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"ledgerType":{"$ref":"#/components/schemas/LedgerTypeENUM"},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/SettlementParameterResponseSchema"}},"settledAt":{"format":"date-time","type":"string"},"settlementCode":{"type":"string"},"settlementUid":{"$ref":"#/components/schemas/UID"},"settlementName":{"type":"string"},"state":{"$ref":"#/components/schemas/SettlementStateENUM"},"status":{"$ref":"#/components/schemas/SettlementStatusENUM"},"storeSettlementIssuer":{"$ref":"#/components/schemas/storeSettlementIssuerSchema"},"tenantUserDisplayName":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"storePaymentMethodUid":{"$ref":"#/components/schemas/UID"},"currency":{"$ref":"#/components/schemas/SettlementCurrencySchema"},"additionalDetails":{"type":"array","items":{"$ref":"#/components/schemas/SettlementAdditionalDetailsSchema"}},"creditCount":{"type":"integer","description":"Number of credits on this settlement. Only applicable for invoice"},"creditAmount":{"type":"integer","description":"The total amount credited. Only applicable for invoice"},"paymentCount":{"type":"integer","description":"Number of payments on this settlement. Only applicable for invoice"},"paymentAmount":{"type":"integer","description":"The total amount of payments. Only applicable for invoice"},"tillUid":{"$ref":"#/components/schemas/OptionalUID"},"tillName":{"type":"string","description":"Display name of the till where the payment was registered."},"tillNumber":{"type":"integer","description":"Till register number where the payment was registered."},"storeUid":{"$ref":"#/components/schemas/OptionalUID"},"storeName":{"type":"string","description":"Display name of the store where the payment was registered."},"orderReceiptUid":{"$ref":"#/components/schemas/OptionalUID"},"authorizedAmount":{"type":"integer","description":"The total authorized amount on this settlement, calculated from authorize transactions."},"capturedAmount":{"type":"integer","description":"The total captured amount on this settlement, calculated from capture transactions."},"refundedAmount":{"type":"integer","description":"The total refunded amount on this settlement, calculated from refund transactions."},"receiptText":{"type":"string","maxLength":500,"description":"Text printed on the receipt for this payment method when configured on the tenant payment method. Empty when not set, when suppressed for this settlement type (e.g. store credit, gift cards), or when cleared."},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/SettlementTransactionSchema"}}}},"SettlementDisplayMessageSchema":{"description":"Settlement display messages","properties":{"key":{"type":"string"},"message":{"type":"string"},"timestamp":{"format":"date-time","type":"string"}},"required":["key","message","timestamp"],"title":"SettlementDisplayMessageSchema","type":"object"},"SettlementIdMethodENUM":{"enum":["NO_CVM_RULE_PERFORMED","SIGNATURE","PIN_ONLINE","PIN_OFFLINE","PIN_ONLINE_AND_SIGNATURE","PIN_OFFLINE_AND_SIGNATURE","NO_CVM","FAILED","ON_DEVICE","REFUND"],"title":"SettlementIdMethodENUM","type":"string"},"LedgerTypeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n|LEDGER | Ledger |\n|GENERAL_LEDGER | General ledger |\n|CUSTOMER_LEDGER | Customer ledger |","enum":["LEDGER","GENERAL_LEDGER","CUSTOMER_LEDGER"],"title":"LedgerTypeENUM","type":"string"},"SettlementParameterResponseSchema":{"description":"settlement parameters response","title":"SettlementParameterResponseSchema","type":"object","required":["key","value","name","type"],"properties":{"key":{"type":"string"},"value":{"type":"string"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/TenantPaymentMethodParameterTypeENUM"}}},"TenantPaymentMethodParameterTypeENUM":{"title":"TenantPaymentMethodParameterTypeENUM","type":"string","enum":["TEXT","INTEGER","NUMERIC","DATE","MOBILE","MODULUS10","MODULUS11"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"SettlementStateENUM":{"enum":["NOT_STARTED","IN_PROGRESS","COMPLETE","TERMINATED"],"title":"SettlementCodeENUM","type":"string"},"SettlementStatusENUM":{"enum":["NEW","PROCESSING","AUTHORIZED","CAPTURED","REFUNDED","PARTIALLY_REFUNDED","PENDING_REFUND","FAILED","CANCELLED_BY_MERCHANT","CANCELLED_BY_USER","CANCELLED_FORCE","DELETED","DENIED","REJECTED"],"title":"SettlementCodeENUM","type":"string"},"storeSettlementIssuerSchema":{"title":"storeSettlementIssuerSchema","type":"object","description":"Settlement issuer information","required":["storeSettlementIssuerUid","name","code"],"properties":{"storeSettlementIssuerUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string","description":"The name of the settlement issuer"},"code":{"type":"string","description":"The code of the settlement issuer"}}},"SettlementCurrencySchema":{"title":"SettlementCurrencySchema","type":"object","required":["amount","code","exchangeRate"],"properties":{"amount":{"type":"integer"},"code":{"type":"string"},"exchangeRate":{"type":"integer"}}},"SettlementAdditionalDetailsSchema":{"title":"SettlementAdditionalDetailsSchema","type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"SettlementTransactionSchema":{"title":"SettlementTransactionSchema","type":"object","required":["transactionType","transactionAmount","orderReceiptUid"],"properties":{"transactionType":{"type":"string"},"pspTransactionId":{"type":"string"},"transactionAmount":{"type":"integer"},"orderReceiptUid":{"$ref":"#/components/schemas/OptionalUID"}}},"Paging":{"description":"totalCount The total number of items in the result set.\n\npageSize The number of items per page.\n\npageNumber The current page in the result set.","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"}},"required":["totalCount","pageSize","pageNumber"],"title":"Paging","type":"object"}},"responses":{"SettlementListResponse":{"content":{"application/json":{"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SettlementResponseSchema"},"type":"array"},"paging":{"$ref":"#/components/schemas/Paging"}},"required":["items","paging"],"type":"object"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}},"description":"Example response"}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/orders/{orderUid}/settlements":{"get":{"description":"List all settlements for an order.\n\nRequired permissions: SALES_ORDER,RETURN_ORDER","operationId":"get-tennants-stores-orders-settlements","parameters":[{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"}],"responses":{"200":{"$ref":"#/components/responses/SettlementListResponse"}},"summary":"List order settlements","tags":["OrderSettlement"]}}}}
```

## Create a new order settlement

> Create a new settlement for an order.\
> \
> Required permissions: SALES\_ORDER,RETURN\_ORDER

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"OrderSettlement","description":"OrderSettlement"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"requestBodies":{"OrderSettlementCreateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderSettlementCreateSchema"}}}}},"schemas":{"OrderSettlementCreateSchema":{"description":"Create a new settlement","title":"OrderSettlementCreateSchema","type":"object","required":["amount","storePaymentMethodUid"],"properties":{"amount":{"description":"in cents, e.g. 1,50 as 150","type":"integer"},"deviceIdentifier":{"type":"string"},"externalId":{"description":"External reference for the settlement","type":"string"},"parameters":{"description":"Refer to each payment type's options for available parameters, e.g. 'mobile' for VIPPS.","type":"array","items":{"$ref":"#/components/schemas/SettlementParameterRequestSchema"}},"storePaymentMethodUid":{"$ref":"#/components/schemas/OptionalUID"},"settlementUid":{"$ref":"#/components/schemas/UID"}}},"SettlementParameterRequestSchema":{"description":"settlement parameters request","title":"SettlementParameterRequestSchema","type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"SettlementResponseSchema":{"title":"SettlementResponseSchema","type":"object","required":["amount","createdAt","displayMessages","externalId","externalPaymentReference","idMethod","lastModifiedAt","parameters","settlementCode","settlementUid","settlementName","state","status","storeSettlementIssuer","tenantUserDisplayName","tenantUserUid","storePaymentMethodUid","currency","additionalDetails","creditCount","creditAmount","paymentCount","paymentAmount","storeUid","storeName","orderReceiptUid","transactions","receiptText"],"properties":{"amount":{"type":"integer"},"createdAt":{"format":"date-time","type":"string"},"displayMessages":{"type":"array","items":{"$ref":"#/components/schemas/SettlementDisplayMessageSchema"}},"externalId":{"type":"string"},"externalPaymentReference":{"type":"string","description":"The external payment reference for this settlement.\nFor invoices, this could contain the KID"},"idMethod":{"$ref":"#/components/schemas/SettlementIdMethodENUM"},"lastModifiedAt":{"format":"date-time","type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"ledgerType":{"$ref":"#/components/schemas/LedgerTypeENUM"},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/SettlementParameterResponseSchema"}},"settledAt":{"format":"date-time","type":"string"},"settlementCode":{"type":"string"},"settlementUid":{"$ref":"#/components/schemas/UID"},"settlementName":{"type":"string"},"state":{"$ref":"#/components/schemas/SettlementStateENUM"},"status":{"$ref":"#/components/schemas/SettlementStatusENUM"},"storeSettlementIssuer":{"$ref":"#/components/schemas/storeSettlementIssuerSchema"},"tenantUserDisplayName":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"storePaymentMethodUid":{"$ref":"#/components/schemas/UID"},"currency":{"$ref":"#/components/schemas/SettlementCurrencySchema"},"additionalDetails":{"type":"array","items":{"$ref":"#/components/schemas/SettlementAdditionalDetailsSchema"}},"creditCount":{"type":"integer","description":"Number of credits on this settlement. Only applicable for invoice"},"creditAmount":{"type":"integer","description":"The total amount credited. Only applicable for invoice"},"paymentCount":{"type":"integer","description":"Number of payments on this settlement. Only applicable for invoice"},"paymentAmount":{"type":"integer","description":"The total amount of payments. Only applicable for invoice"},"tillUid":{"$ref":"#/components/schemas/OptionalUID"},"tillName":{"type":"string","description":"Display name of the till where the payment was registered."},"tillNumber":{"type":"integer","description":"Till register number where the payment was registered."},"storeUid":{"$ref":"#/components/schemas/OptionalUID"},"storeName":{"type":"string","description":"Display name of the store where the payment was registered."},"orderReceiptUid":{"$ref":"#/components/schemas/OptionalUID"},"authorizedAmount":{"type":"integer","description":"The total authorized amount on this settlement, calculated from authorize transactions."},"capturedAmount":{"type":"integer","description":"The total captured amount on this settlement, calculated from capture transactions."},"refundedAmount":{"type":"integer","description":"The total refunded amount on this settlement, calculated from refund transactions."},"receiptText":{"type":"string","maxLength":500,"description":"Text printed on the receipt for this payment method when configured on the tenant payment method. Empty when not set, when suppressed for this settlement type (e.g. store credit, gift cards), or when cleared."},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/SettlementTransactionSchema"}}}},"SettlementDisplayMessageSchema":{"description":"Settlement display messages","properties":{"key":{"type":"string"},"message":{"type":"string"},"timestamp":{"format":"date-time","type":"string"}},"required":["key","message","timestamp"],"title":"SettlementDisplayMessageSchema","type":"object"},"SettlementIdMethodENUM":{"enum":["NO_CVM_RULE_PERFORMED","SIGNATURE","PIN_ONLINE","PIN_OFFLINE","PIN_ONLINE_AND_SIGNATURE","PIN_OFFLINE_AND_SIGNATURE","NO_CVM","FAILED","ON_DEVICE","REFUND"],"title":"SettlementIdMethodENUM","type":"string"},"LedgerTypeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n|LEDGER | Ledger |\n|GENERAL_LEDGER | General ledger |\n|CUSTOMER_LEDGER | Customer ledger |","enum":["LEDGER","GENERAL_LEDGER","CUSTOMER_LEDGER"],"title":"LedgerTypeENUM","type":"string"},"SettlementParameterResponseSchema":{"description":"settlement parameters response","title":"SettlementParameterResponseSchema","type":"object","required":["key","value","name","type"],"properties":{"key":{"type":"string"},"value":{"type":"string"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/TenantPaymentMethodParameterTypeENUM"}}},"TenantPaymentMethodParameterTypeENUM":{"title":"TenantPaymentMethodParameterTypeENUM","type":"string","enum":["TEXT","INTEGER","NUMERIC","DATE","MOBILE","MODULUS10","MODULUS11"]},"SettlementStateENUM":{"enum":["NOT_STARTED","IN_PROGRESS","COMPLETE","TERMINATED"],"title":"SettlementCodeENUM","type":"string"},"SettlementStatusENUM":{"enum":["NEW","PROCESSING","AUTHORIZED","CAPTURED","REFUNDED","PARTIALLY_REFUNDED","PENDING_REFUND","FAILED","CANCELLED_BY_MERCHANT","CANCELLED_BY_USER","CANCELLED_FORCE","DELETED","DENIED","REJECTED"],"title":"SettlementCodeENUM","type":"string"},"storeSettlementIssuerSchema":{"title":"storeSettlementIssuerSchema","type":"object","description":"Settlement issuer information","required":["storeSettlementIssuerUid","name","code"],"properties":{"storeSettlementIssuerUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string","description":"The name of the settlement issuer"},"code":{"type":"string","description":"The code of the settlement issuer"}}},"SettlementCurrencySchema":{"title":"SettlementCurrencySchema","type":"object","required":["amount","code","exchangeRate"],"properties":{"amount":{"type":"integer"},"code":{"type":"string"},"exchangeRate":{"type":"integer"}}},"SettlementAdditionalDetailsSchema":{"title":"SettlementAdditionalDetailsSchema","type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}},"SettlementTransactionSchema":{"title":"SettlementTransactionSchema","type":"object","required":["transactionType","transactionAmount","orderReceiptUid"],"properties":{"transactionType":{"type":"string"},"pspTransactionId":{"type":"string"},"transactionAmount":{"type":"integer"},"orderReceiptUid":{"$ref":"#/components/schemas/OptionalUID"}}}},"responses":{"SettlementResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementResponseSchema"}}},"description":"Example response"}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/orders/{orderUid}/settlements":{"post":{"description":"Create a new settlement for an order.\n\nRequired permissions: SALES_ORDER,RETURN_ORDER","operationId":"post-tennants-stores-orders-settlements","requestBody":{"$ref":"#/components/requestBodies/OrderSettlementCreateRequest"},"responses":{"200":{"$ref":"#/components/responses/SettlementResponse"}},"summary":"Create a new order settlement","tags":["OrderSettlement"]}}}}
```

## Get order settlement details

> Get details for a specific settlement on an order.\
> \
> Required permissions: SALES\_ORDER,RETURN\_ORDER

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"OrderSettlement","description":"OrderSettlement"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"parameters":{"checkStatusQuery":{"description":"Check external payment gateways and fetch status","in":"query","name":"checkStatus","schema":{"type":"boolean"}},"includeDisplayMessagesQuery":{"description":"Include display messages in the response","in":"query","name":"includeDisplayMessages","schema":{"type":"boolean"}}},"responses":{"SettlementResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementResponseSchema"}}},"description":"Example response"}},"schemas":{"SettlementResponseSchema":{"title":"SettlementResponseSchema","type":"object","required":["amount","createdAt","displayMessages","externalId","externalPaymentReference","idMethod","lastModifiedAt","parameters","settlementCode","settlementUid","settlementName","state","status","storeSettlementIssuer","tenantUserDisplayName","tenantUserUid","storePaymentMethodUid","currency","additionalDetails","creditCount","creditAmount","paymentCount","paymentAmount","storeUid","storeName","orderReceiptUid","transactions","receiptText"],"properties":{"amount":{"type":"integer"},"createdAt":{"format":"date-time","type":"string"},"displayMessages":{"type":"array","items":{"$ref":"#/components/schemas/SettlementDisplayMessageSchema"}},"externalId":{"type":"string"},"externalPaymentReference":{"type":"string","description":"The external payment reference for this settlement.\nFor invoices, this could contain the KID"},"idMethod":{"$ref":"#/components/schemas/SettlementIdMethodENUM"},"lastModifiedAt":{"format":"date-time","type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"ledgerType":{"$ref":"#/components/schemas/LedgerTypeENUM"},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/SettlementParameterResponseSchema"}},"settledAt":{"format":"date-time","type":"string"},"settlementCode":{"type":"string"},"settlementUid":{"$ref":"#/components/schemas/UID"},"settlementName":{"type":"string"},"state":{"$ref":"#/components/schemas/SettlementStateENUM"},"status":{"$ref":"#/components/schemas/SettlementStatusENUM"},"storeSettlementIssuer":{"$ref":"#/components/schemas/storeSettlementIssuerSchema"},"tenantUserDisplayName":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"storePaymentMethodUid":{"$ref":"#/components/schemas/UID"},"currency":{"$ref":"#/components/schemas/SettlementCurrencySchema"},"additionalDetails":{"type":"array","items":{"$ref":"#/components/schemas/SettlementAdditionalDetailsSchema"}},"creditCount":{"type":"integer","description":"Number of credits on this settlement. Only applicable for invoice"},"creditAmount":{"type":"integer","description":"The total amount credited. Only applicable for invoice"},"paymentCount":{"type":"integer","description":"Number of payments on this settlement. Only applicable for invoice"},"paymentAmount":{"type":"integer","description":"The total amount of payments. Only applicable for invoice"},"tillUid":{"$ref":"#/components/schemas/OptionalUID"},"tillName":{"type":"string","description":"Display name of the till where the payment was registered."},"tillNumber":{"type":"integer","description":"Till register number where the payment was registered."},"storeUid":{"$ref":"#/components/schemas/OptionalUID"},"storeName":{"type":"string","description":"Display name of the store where the payment was registered."},"orderReceiptUid":{"$ref":"#/components/schemas/OptionalUID"},"authorizedAmount":{"type":"integer","description":"The total authorized amount on this settlement, calculated from authorize transactions."},"capturedAmount":{"type":"integer","description":"The total captured amount on this settlement, calculated from capture transactions."},"refundedAmount":{"type":"integer","description":"The total refunded amount on this settlement, calculated from refund transactions."},"receiptText":{"type":"string","maxLength":500,"description":"Text printed on the receipt for this payment method when configured on the tenant payment method. Empty when not set, when suppressed for this settlement type (e.g. store credit, gift cards), or when cleared."},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/SettlementTransactionSchema"}}}},"SettlementDisplayMessageSchema":{"description":"Settlement display messages","properties":{"key":{"type":"string"},"message":{"type":"string"},"timestamp":{"format":"date-time","type":"string"}},"required":["key","message","timestamp"],"title":"SettlementDisplayMessageSchema","type":"object"},"SettlementIdMethodENUM":{"enum":["NO_CVM_RULE_PERFORMED","SIGNATURE","PIN_ONLINE","PIN_OFFLINE","PIN_ONLINE_AND_SIGNATURE","PIN_OFFLINE_AND_SIGNATURE","NO_CVM","FAILED","ON_DEVICE","REFUND"],"title":"SettlementIdMethodENUM","type":"string"},"LedgerTypeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n|LEDGER | Ledger |\n|GENERAL_LEDGER | General ledger |\n|CUSTOMER_LEDGER | Customer ledger |","enum":["LEDGER","GENERAL_LEDGER","CUSTOMER_LEDGER"],"title":"LedgerTypeENUM","type":"string"},"SettlementParameterResponseSchema":{"description":"settlement parameters response","title":"SettlementParameterResponseSchema","type":"object","required":["key","value","name","type"],"properties":{"key":{"type":"string"},"value":{"type":"string"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/TenantPaymentMethodParameterTypeENUM"}}},"TenantPaymentMethodParameterTypeENUM":{"title":"TenantPaymentMethodParameterTypeENUM","type":"string","enum":["TEXT","INTEGER","NUMERIC","DATE","MOBILE","MODULUS10","MODULUS11"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"SettlementStateENUM":{"enum":["NOT_STARTED","IN_PROGRESS","COMPLETE","TERMINATED"],"title":"SettlementCodeENUM","type":"string"},"SettlementStatusENUM":{"enum":["NEW","PROCESSING","AUTHORIZED","CAPTURED","REFUNDED","PARTIALLY_REFUNDED","PENDING_REFUND","FAILED","CANCELLED_BY_MERCHANT","CANCELLED_BY_USER","CANCELLED_FORCE","DELETED","DENIED","REJECTED"],"title":"SettlementCodeENUM","type":"string"},"storeSettlementIssuerSchema":{"title":"storeSettlementIssuerSchema","type":"object","description":"Settlement issuer information","required":["storeSettlementIssuerUid","name","code"],"properties":{"storeSettlementIssuerUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string","description":"The name of the settlement issuer"},"code":{"type":"string","description":"The code of the settlement issuer"}}},"SettlementCurrencySchema":{"title":"SettlementCurrencySchema","type":"object","required":["amount","code","exchangeRate"],"properties":{"amount":{"type":"integer"},"code":{"type":"string"},"exchangeRate":{"type":"integer"}}},"SettlementAdditionalDetailsSchema":{"title":"SettlementAdditionalDetailsSchema","type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"SettlementTransactionSchema":{"title":"SettlementTransactionSchema","type":"object","required":["transactionType","transactionAmount","orderReceiptUid"],"properties":{"transactionType":{"type":"string"},"pspTransactionId":{"type":"string"},"transactionAmount":{"type":"integer"},"orderReceiptUid":{"$ref":"#/components/schemas/OptionalUID"}}}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/orders/{orderUid}/settlements/{settlementUid}":{"get":{"description":"Get details for a specific settlement on an order.\n\nRequired permissions: SALES_ORDER,RETURN_ORDER","operationId":"get-tennants-stores-orders-settlements-details","parameters":[{"$ref":"#/components/parameters/checkStatusQuery"},{"$ref":"#/components/parameters/includeDisplayMessagesQuery"}],"responses":{"200":{"$ref":"#/components/responses/SettlementResponse"}},"summary":"Get order settlement details","tags":["OrderSettlement"]}}}}
```

## Update order settlement details

> Update settlement details

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"OrderSettlement","description":"OrderSettlement"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"SettlementResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementResponseSchema"}}},"description":"Example response"}},"schemas":{"SettlementResponseSchema":{"title":"SettlementResponseSchema","type":"object","required":["amount","createdAt","displayMessages","externalId","externalPaymentReference","idMethod","lastModifiedAt","parameters","settlementCode","settlementUid","settlementName","state","status","storeSettlementIssuer","tenantUserDisplayName","tenantUserUid","storePaymentMethodUid","currency","additionalDetails","creditCount","creditAmount","paymentCount","paymentAmount","storeUid","storeName","orderReceiptUid","transactions","receiptText"],"properties":{"amount":{"type":"integer"},"createdAt":{"format":"date-time","type":"string"},"displayMessages":{"type":"array","items":{"$ref":"#/components/schemas/SettlementDisplayMessageSchema"}},"externalId":{"type":"string"},"externalPaymentReference":{"type":"string","description":"The external payment reference for this settlement.\nFor invoices, this could contain the KID"},"idMethod":{"$ref":"#/components/schemas/SettlementIdMethodENUM"},"lastModifiedAt":{"format":"date-time","type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"ledgerType":{"$ref":"#/components/schemas/LedgerTypeENUM"},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/SettlementParameterResponseSchema"}},"settledAt":{"format":"date-time","type":"string"},"settlementCode":{"type":"string"},"settlementUid":{"$ref":"#/components/schemas/UID"},"settlementName":{"type":"string"},"state":{"$ref":"#/components/schemas/SettlementStateENUM"},"status":{"$ref":"#/components/schemas/SettlementStatusENUM"},"storeSettlementIssuer":{"$ref":"#/components/schemas/storeSettlementIssuerSchema"},"tenantUserDisplayName":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"storePaymentMethodUid":{"$ref":"#/components/schemas/UID"},"currency":{"$ref":"#/components/schemas/SettlementCurrencySchema"},"additionalDetails":{"type":"array","items":{"$ref":"#/components/schemas/SettlementAdditionalDetailsSchema"}},"creditCount":{"type":"integer","description":"Number of credits on this settlement. Only applicable for invoice"},"creditAmount":{"type":"integer","description":"The total amount credited. Only applicable for invoice"},"paymentCount":{"type":"integer","description":"Number of payments on this settlement. Only applicable for invoice"},"paymentAmount":{"type":"integer","description":"The total amount of payments. Only applicable for invoice"},"tillUid":{"$ref":"#/components/schemas/OptionalUID"},"tillName":{"type":"string","description":"Display name of the till where the payment was registered."},"tillNumber":{"type":"integer","description":"Till register number where the payment was registered."},"storeUid":{"$ref":"#/components/schemas/OptionalUID"},"storeName":{"type":"string","description":"Display name of the store where the payment was registered."},"orderReceiptUid":{"$ref":"#/components/schemas/OptionalUID"},"authorizedAmount":{"type":"integer","description":"The total authorized amount on this settlement, calculated from authorize transactions."},"capturedAmount":{"type":"integer","description":"The total captured amount on this settlement, calculated from capture transactions."},"refundedAmount":{"type":"integer","description":"The total refunded amount on this settlement, calculated from refund transactions."},"receiptText":{"type":"string","maxLength":500,"description":"Text printed on the receipt for this payment method when configured on the tenant payment method. Empty when not set, when suppressed for this settlement type (e.g. store credit, gift cards), or when cleared."},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/SettlementTransactionSchema"}}}},"SettlementDisplayMessageSchema":{"description":"Settlement display messages","properties":{"key":{"type":"string"},"message":{"type":"string"},"timestamp":{"format":"date-time","type":"string"}},"required":["key","message","timestamp"],"title":"SettlementDisplayMessageSchema","type":"object"},"SettlementIdMethodENUM":{"enum":["NO_CVM_RULE_PERFORMED","SIGNATURE","PIN_ONLINE","PIN_OFFLINE","PIN_ONLINE_AND_SIGNATURE","PIN_OFFLINE_AND_SIGNATURE","NO_CVM","FAILED","ON_DEVICE","REFUND"],"title":"SettlementIdMethodENUM","type":"string"},"LedgerTypeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n|LEDGER | Ledger |\n|GENERAL_LEDGER | General ledger |\n|CUSTOMER_LEDGER | Customer ledger |","enum":["LEDGER","GENERAL_LEDGER","CUSTOMER_LEDGER"],"title":"LedgerTypeENUM","type":"string"},"SettlementParameterResponseSchema":{"description":"settlement parameters response","title":"SettlementParameterResponseSchema","type":"object","required":["key","value","name","type"],"properties":{"key":{"type":"string"},"value":{"type":"string"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/TenantPaymentMethodParameterTypeENUM"}}},"TenantPaymentMethodParameterTypeENUM":{"title":"TenantPaymentMethodParameterTypeENUM","type":"string","enum":["TEXT","INTEGER","NUMERIC","DATE","MOBILE","MODULUS10","MODULUS11"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"SettlementStateENUM":{"enum":["NOT_STARTED","IN_PROGRESS","COMPLETE","TERMINATED"],"title":"SettlementCodeENUM","type":"string"},"SettlementStatusENUM":{"enum":["NEW","PROCESSING","AUTHORIZED","CAPTURED","REFUNDED","PARTIALLY_REFUNDED","PENDING_REFUND","FAILED","CANCELLED_BY_MERCHANT","CANCELLED_BY_USER","CANCELLED_FORCE","DELETED","DENIED","REJECTED"],"title":"SettlementCodeENUM","type":"string"},"storeSettlementIssuerSchema":{"title":"storeSettlementIssuerSchema","type":"object","description":"Settlement issuer information","required":["storeSettlementIssuerUid","name","code"],"properties":{"storeSettlementIssuerUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string","description":"The name of the settlement issuer"},"code":{"type":"string","description":"The code of the settlement issuer"}}},"SettlementCurrencySchema":{"title":"SettlementCurrencySchema","type":"object","required":["amount","code","exchangeRate"],"properties":{"amount":{"type":"integer"},"code":{"type":"string"},"exchangeRate":{"type":"integer"}}},"SettlementAdditionalDetailsSchema":{"title":"SettlementAdditionalDetailsSchema","type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"SettlementTransactionSchema":{"title":"SettlementTransactionSchema","type":"object","required":["transactionType","transactionAmount","orderReceiptUid"],"properties":{"transactionType":{"type":"string"},"pspTransactionId":{"type":"string"},"transactionAmount":{"type":"integer"},"orderReceiptUid":{"$ref":"#/components/schemas/OptionalUID"}}},"OrderSettlementUpdateSchema":{"description":"Update settlement details","title":"OrderSettlementUpdateSchema","type":"object","properties":{"externalId":{"description":"External reference for the settlement","type":"string"},"parameters":{"description":"Refer to each payment type's options for available parameters, e.g. 'mobile' for VIPPS.","type":"array","items":{"$ref":"#/components/schemas/SettlementParameterRequestSchema"}}}},"SettlementParameterRequestSchema":{"description":"settlement parameters request","title":"SettlementParameterRequestSchema","type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"requestBodies":{"SettlementUpdateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderSettlementUpdateSchema"}}}}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/orders/{orderUid}/settlements/{settlementUid}":{"put":{"summary":"Update order settlement details","tags":["OrderSettlement"],"responses":{"200":{"$ref":"#/components/responses/SettlementResponse"}},"operationId":"put-tenants-stores-orders-settlements-details","description":"Update settlement details","requestBody":{"$ref":"#/components/requestBodies/SettlementUpdateRequest"}}}}}
```

## Delete an order settlement

> Delete a settlement on an order.\
> \
> Required permissions: SALES\_ORDER,RETURN\_ORDER

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"OrderSettlement","description":"OrderSettlement"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"parameters":{"forceDeleteQuery":{"description":"Force Delete on a settlement","in":"query","name":"forceDelete","schema":{"type":"boolean"}}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/orders/{orderUid}/settlements/{settlementUid}":{"delete":{"description":"Delete a settlement on an order.\n\nRequired permissions: SALES_ORDER,RETURN_ORDER","operationId":"delete-tennants-stores-orders-settlements-details","parameters":[{"$ref":"#/components/parameters/forceDeleteQuery"}],"responses":{"204":{"description":"No Content"},"403":{"description":"Forbidden"}},"summary":"Delete an order settlement","tags":["OrderSettlement"]}}}}
```

## List payments for settlement

> A payment belongs to an order settlement with payment method \`INVOICE\`.\
> Normally invoices are paid via bank and the payments imported or also registered by hand.\
> But if a customer pays the invoice by another method in the store (e.g. cash or card), \
> it is made as a settlement on a new order without any lines, and then shown as \`paymentSettlement\`.\
> \
> Required permissions: PAYMENT

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"OrderSettlement","description":"OrderSettlement"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"PaymentListResponse":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PaymentResponseSchema"}}}}}}}},"schemas":{"PaymentResponseSchema":{"title":"PaymentResponseSchema","type":"object","required":["paymentUid","amount","paidAt","externalReference","paymentSettlementUid","createdAt","createdBy"],"properties":{"paymentUid":{"$ref":"#/components/schemas/UID"},"amount":{"type":"integer"},"paidAt":{"type":"string","format":"date-time"},"externalReference":{"type":"string"},"paymentSettlementUid":{"$ref":"#/components/schemas/OptionalUID"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/orders/{orderUid}/settlements/{settlementUid}/payments":{"get":{"summary":"List payments for settlement","tags":["OrderSettlement"],"responses":{"200":{"$ref":"#/components/responses/PaymentListResponse"}},"operationId":"list-settlements-payments","description":"A payment belongs to an order settlement with payment method `INVOICE`.\nNormally invoices are paid via bank and the payments imported or also registered by hand.\nBut if a customer pays the invoice by another method in the store (e.g. cash or card), \nit is made as a settlement on a new order without any lines, and then shown as `paymentSettlement`.\n\nRequired permissions: PAYMENT"}}}}
```

## Add payment for settlement

> Add a payment for a settlement.  \
> \`amount\` is in cents.  \
> If \`paidAt\` is nil, it is set to \`now\`.\
> \
> Required permissions: PAYMENT

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"OrderSettlement","description":"OrderSettlement"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"PaymentResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentResponseSchema"}}}}},"schemas":{"PaymentResponseSchema":{"title":"PaymentResponseSchema","type":"object","required":["paymentUid","amount","paidAt","externalReference","paymentSettlementUid","createdAt","createdBy"],"properties":{"paymentUid":{"$ref":"#/components/schemas/UID"},"amount":{"type":"integer"},"paidAt":{"type":"string","format":"date-time"},"externalReference":{"type":"string"},"paymentSettlementUid":{"$ref":"#/components/schemas/OptionalUID"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"}},"requestBodies":{"PaymentCreateRequest":{"content":{"application/json":{"schema":{"type":"object","required":["amount"],"properties":{"amount":{"type":"integer"},"paidAt":{"type":"string","format":"date-time"},"externalReference":{"type":"string"},"paymentUid":{"$ref":"#/components/schemas/OptionalUID"}}}}}}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/orders/{orderUid}/settlements/{settlementUid}/payments":{"post":{"summary":"Add payment for settlement","tags":["OrderSettlement"],"responses":{"201":{"$ref":"#/components/responses/PaymentResponse"}},"operationId":"post-settlements-payments","description":"Add a payment for a settlement.  \n`amount` is in cents.  \nIf `paidAt` is nil, it is set to `now`.\n\nRequired permissions: PAYMENT","requestBody":{"$ref":"#/components/requestBodies/PaymentCreateRequest"}}}}}
```

## Batch add payments for a list of settlements

> Add multiple payments for settlements in a single request.\
> storeUid, orderUid and settlementUid are required for each payment.\
> \`amount\` is in cents for each payment.\
> If \`paidAt\` is nil for any payment, it is set to \`now\`.\
> Returns 204 (No Content) if all payments are successfully created.\
> \
> Required permissions: PAYMENT

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"OrderSettlement","description":"OrderSettlement"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"requestBodies":{"PaymentBatchRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentBatchRequestSchema"}}}}},"schemas":{"PaymentBatchRequestSchema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PaymentBatchSchema"}}}},"PaymentBatchSchema":{"title":"PaymentBatchSchema","type":"object","required":["storeUid","orderUid","settlementUid","amount"],"properties":{"storeUid":{"$ref":"#/components/schemas/UID"},"orderUid":{"$ref":"#/components/schemas/UID"},"settlementUid":{"$ref":"#/components/schemas/UID"},"amount":{"type":"integer"},"paidAt":{"type":"string","format":"date-time"},"externalReference":{"type":"string"},"paymentUid":{"$ref":"#/components/schemas/OptionalUID"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"}}},"paths":{"/tenants/{tenantUid}/payments/batch":{"post":{"summary":"Batch add payments for a list of settlements","tags":["OrderSettlement"],"responses":{"204":{"description":"All payments were successfully created"}},"operationId":"post-settlements-payments-batch","description":"Add multiple payments for settlements in a single request.\nstoreUid, orderUid and settlementUid are required for each payment.\n`amount` is in cents for each payment.\nIf `paidAt` is nil for any payment, it is set to `now`.\nReturns 204 (No Content) if all payments are successfully created.\n\nRequired permissions: PAYMENT","requestBody":{"$ref":"#/components/requestBodies/PaymentBatchRequest"}}}}}
```

## Create new payment-settlement

> A payment belongs to an order settlement with payment method \`INVOICE\`.\
> Normally invoices are paid via bank and the payments imported or also registered by hand.\
> But if a customer pays the invoice by another method in store (e.g. cash or card) \
> it is made as a settlement on a new order without any lines, and this is what we do here, \
> meaning the path parameters must refer to the order and settlement for which this is a payment.\
> \
> Required permissions: PAYMENT

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"OrderSettlement","description":"OrderSettlement"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"OrderResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseSchema"}}},"description":"Example response"}},"schemas":{"OrderResponseSchema":{"description":"Use invoiceAddress only if an order has a different invoice  than orderAddress.","title":"OrderResponseSchema","type":"object","required":["createdAt","customerAddress","customerUid","customerContact","deliveryState","externalOrderNumber","externalVoucherNumber","invoiceAddress","items","lastModifiedAt","note","internalNote","orderUid","orderNumber","orderDate","orderState","orderTotals","orderhandlingState","orderhandlings","settleState","settlementTotals","settlements","storeUid","storeName","systemOrigin","tenantUserDisplayName","tenantUserUid","tillUid","type","vatFree","vatPrint","voucherNumber","deliveryDate","discounts","compensationReasonUid","lastModifiedBy","allowedActions"],"properties":{"createdAt":{"format":"date-time","type":"string"},"customerAddress":{"$ref":"#/components/schemas/OrderAddressResponseSchema"},"customerUid":{"$ref":"#/components/schemas/OptionalUID"},"customerContact":{"$ref":"#/components/schemas/OrderCustomerContactResponseSchema"},"deliveryState":{"$ref":"#/components/schemas/OrderDeliveryStateENUM"},"externalOrderNumber":{"type":"string"},"externalVoucherNumber":{"type":"string"},"invoiceAddress":{"$ref":"#/components/schemas/InvoiceAddressResponseSchema"},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemResponseSchema"}},"lastModifiedAt":{"format":"date-time","type":"string"},"note":{"description":"Note visible on the receipt.","type":"string"},"internalNote":{"type":"string","description":"Internal note, not visible on the receipt."},"orderUid":{"$ref":"#/components/schemas/UID"},"orderNumber":{"type":"string"},"orderDate":{"type":"string","format":"date-time","description":"This field has value if type == `ORDER`","nullable":true},"orderState":{"$ref":"#/components/schemas/OrderOrderStateENUM"},"orderTotals":{"$ref":"#/components/schemas/OrderTotalsResponseSchema"},"orderhandlingState":{"$ref":"#/components/schemas/HandlingStateENUM"},"orderhandlings":{"type":"array","items":{"$ref":"#/components/schemas/OrderHandlingResponseSchema"}},"settleState":{"$ref":"#/components/schemas/OrderSettleStateENUM"},"settledAt":{"description":"When the settleState is set COMPLETE.","format":"date-time","type":"string","nullable":true},"settlementTotals":{"$ref":"#/components/schemas/OrderSettlementTotalsSchema"},"settlements":{"type":"array","items":{"$ref":"#/components/schemas/SettlementResponseSchema"}},"storeUid":{"$ref":"#/components/schemas/UID"},"storeName":{"type":"string"},"systemOrigin":{"type":"string"},"tenantUserDisplayName":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"tillUid":{"$ref":"#/components/schemas/OptionalUID"},"type":{"$ref":"#/components/schemas/OrderTypeENUM"},"validUntil":{"format":"date-time","type":"string","nullable":true},"vatFree":{"type":"boolean"},"vatPrint":{"$ref":"#/components/schemas/VatPrintENUM"},"voucherNumber":{"description":"A reference to a fully settled order.","type":"string"},"deliveryDate":{"type":"string","format":"date"},"discounts":{"type":"array","items":{"$ref":"#/components/schemas/OrderDiscountResponseSchema"}},"compensationReasonUid":{"$ref":"#/components/schemas/OptionalUID"},"lastModifiedBy":{"type":"string"},"allowedActions":{"type":"array","items":{"$ref":"#/components/schemas/AllowedOrderActionENUM"}}}},"OrderAddressResponseSchema":{"title":"OrderAddressResponseSchema","type":"object","required":["address","city","companyName","countryCode","email","firstname","lastname","mobile","postalCode","displayName"],"properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"countryCode":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"firstname":{"type":"string"},"lastname":{"type":"string"},"mobile":{"type":"string"},"postalCode":{"type":"string"},"vatNumber":{"$ref":"#/components/schemas/VatNumberTYPE"},"displayName":{"type":"string"}},"description":""},"EmailTYPE":{"title":"Email","type":"string"},"VatNumberTYPE":{"description":"VAT identification number for value added tax reporting purposes.","title":"VatNumber","type":"string"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"OrderCustomerContactResponseSchema":{"type":"object","title":"OrderCustomerContactResponseSchema","required":["customerContactUid","firstname","lastname","email","mobile","displayName"],"properties":{"customerContactUid":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"mobile":{"type":"string"},"displayName":{"type":"string"}}},"OrderDeliveryStateENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NOT_STARTED | Delivery not started|\n| IN_PROGRESS | Delivery is in progress. Some order lines are still reserved|\n| COMPLETE | Delivery is complete. All order lines are delivered|","enum":["NOT_STARTED","IN_PROGRESS","COMPLETE"],"title":"OrderDeliveryStateENUM","type":"string"},"InvoiceAddressResponseSchema":{"title":"InvoiceAddressResponseSchema","allOf":[{"$ref":"#/components/schemas/BaseAddressSchema"},{"required":["displayName","customerAddressUid","address","city","companyName","countryCode","email","mobile","firstname","lastname","postalCode"],"properties":{"displayName":{"type":"string"},"customerAddressUid":{"$ref":"#/components/schemas/OptionalUID"}}}],"type":"object"},"BaseAddressSchema":{"title":"BaseAddressSchema","type":"object","properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"countryCode":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"mobile":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"postalCode":{"type":"string"}}},"OrderItemResponseSchema":{"title":"OrderItemResponseSchema","type":"object","required":["actions","allowedActions","createdAt","discountReasonCode","externalId","itemCost","itemDiscountAmount","itemDiscountPercentage","itemGrossProfitAmount","itemGrossProfitPercentage","itemPrice","itemVatAmount","lastModifiedAt","ledgerNumber","name","note","orderItemUid","originalItemPrice","productUid","productType","properties","quantityCredited","quantityDelivered","quantityOrdered","quantityReserved","returnReasonCode","serialnumber","sku","sortOrder","tenantUserDisplayName","tenantUserUid","totalCost","totalDiscountAmount","totalGrossProfitAmount","totalPrice","totalVatAmount","vatCodeUid","warehouseUid","warehouseName","internalInfo","productProperties","coverImage","deliveryUid","compensationReasonCode","orderReceiptUid","allowDelivery","allowDeliveryFromDate","reservationType","reservationDetails","gtins"],"properties":{"actions":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemActionResponseSchema"}},"allowedActions":{"description":"Indicate what fields are allowed to change or what action is allowed on an orderline","type":"array","items":{"$ref":"#/components/schemas/AllowedActionENUM"}},"createdAt":{"format":"date-time","type":"string"},"discountReasonCode":{"type":"string"},"externalId":{"type":"string"},"itemCost":{"description":"Item cost for a single product.","type":"integer"},"itemDiscountAmount":{"description":"Discount amount for a single product.","type":"integer"},"itemDiscountPercentage":{"type":"integer"},"itemGrossProfitAmount":{"description":"Profit amount for a single product.","type":"integer"},"itemGrossProfitPercentage":{"description":"Profit for a single product in percentage.","type":"integer"},"itemPrice":{"type":"integer"},"itemVatAmount":{"description":"Vat amount for a single product.","type":"integer"},"lastModifiedAt":{"format":"date-time","type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"name":{"type":"string"},"note":{"type":"string"},"orderItemUid":{"$ref":"#/components/schemas/UID"},"orderLinks":{"description":"List of references on the order product item.\nTypically a list of credit operations.","type":"array","items":{"$ref":"#/components/schemas/OrderLinkTypeSchema"}},"originalItemPrice":{"type":"integer"},"productUid":{"$ref":"#/components/schemas/UID"},"productType":{"$ref":"#/components/schemas/ProductTypeENUM"},"properties":{"type":"array","items":{"$ref":"#/components/schemas/OrderProductLinePropertyResponseSchema"}},"quantityCredited":{"type":"integer"},"quantityDelivered":{"type":"integer"},"quantityOrdered":{"type":"integer"},"quantityReserved":{"type":"integer"},"returnReasonCode":{"type":"string"},"serialnumber":{"type":"string"},"sku":{"type":"string"},"sortOrder":{"type":"integer"},"tenantUserDisplayName":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"totalCost":{"description":"Total cost for all products on this OrderItem.","type":"integer"},"totalDiscountAmount":{"description":"Discount amount for all products on this OrderItem.","type":"integer"},"totalGrossProfitAmount":{"description":"Profit amount for all products on this OrderItem.","type":"integer"},"totalPrice":{"description":"Total price for all products on this OrderItem.","type":"integer"},"totalVatAmount":{"description":"Vat amount for all products on this OrderItem.","type":"integer"},"vatCodeUid":{"$ref":"#/components/schemas/UID"},"warehouseUid":{"$ref":"#/components/schemas/OptionalUID"},"warehouseName":{"type":"string"},"internalInfo":{"type":"string"},"productProperties":{"type":"array","items":{"$ref":"#/components/schemas/ProductPropertyResponseSchema"}},"coverImage":{"$ref":"#/components/schemas/CoverImageSchema"},"deliveryUid":{"$ref":"#/components/schemas/OptionalUID"},"compensationReasonCode":{"type":"string"},"orderReceiptUid":{"$ref":"#/components/schemas/OptionalUID"},"allowDelivery":{"$ref":"#/components/schemas/AllowDeliveryENUM"},"allowDeliveryFromDate":{"type":"string","format":"date-time","description":"When allowDelivery is `NOT_BEFORE_DATE` this field will contain the time for when the product is allowed to be delivered from.","nullable":true},"reservationType":{"$ref":"#/components/schemas/SalesReservationTypeENUM"},"reservationDetails":{"$ref":"#/components/schemas/SalesReservationDetailsSchema"},"gtins":{"type":"array","items":{"$ref":"#/components/schemas/ProductGtinSchema"}}}},"OrderItemActionResponseSchema":{"properties":{"comment":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"handlingActionUid":{"$ref":"#/components/schemas/UID"},"handlingActionName":{"type":"string"},"handlingDescription":{"type":"string"},"handlingUid":{"$ref":"#/components/schemas/UID"},"handlingName":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"orderHandlingActionUid":{"$ref":"#/components/schemas/UID"}},"required":["orderHandlingActionUid","handlingUid","handlingName","handlingActionUid","handlingActionName","comment","handlingDescription","createdAt","createdBy","lastModifiedAt","lastModifiedBy"],"title":"OrderItemActionResponseSchema","type":"object"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"AllowedActionENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| QUANTITY_SOLD | Can change quantity on order item|\n| PRICE_SALE | Can change price on order item|\n| DISCOUNT | Can set discount on order item|\n| SERIALNUMBER | Can set serial number on order item|\n| SERIALNUMBER_REQUIRED | MUST set serial number on order item|\n| CREDIT | Order item can be credited|\n| ADDON | Product on order item has addons|\n| CUSTOMER_REQUIRED | Order item requires customer on settlement|\n| CUSTOMER_MOBILE_REQUIRED | Order item requires customer mobile number on settlement|\n| CUSTOMER_EMAIL_REQUIRED  - Order item requires customer email on settlement|\n| DELIVERY_POSTAL_ADDRESS_REQUIRED | Order item requires delivery address on settlement|\n| INSURANCE | Order item can be insured|\n| DELETE | Order item can be deleted|   \n| DELIVER | Order item can be delivered|\n| PURCHASE | Order item can be marked as purchase from supplier |\n| COST_PRICE | Set cost price on the orderItem |\n| PRODUCT_NAME | Set name of the product on the orderItem |\n| PAYABLE | order item is payable |\n| NEGATIVE_PRICE| Can have negative price |","enum":["QUANTITY_SOLD","PRICE_SALE","DISCOUNT","SERIALNUMBER","SERIALNUMBER_REQUIRED","CREDIT","ADDON","CUSTOMER_REQUIRED","INSURANCE","CUSTOMER_MOBILE_REQUIRED","CUSTOMER_EMAIL_REQUIRED","DELIVERY_POSTAL_ADDRESS_REQUIRED","DELETE","DELIVER","PURCHASE","COST_PRICE","PRODUCT_NAME","PAYABLE","NEGATIVE_PRICE"],"title":"AllowedActionENUM","type":"string"},"OrderLinkTypeSchema":{"description":"Order reference for an order product item","properties":{"orderUid":{"$ref":"#/components/schemas/UID"},"orderItemUid":{"$ref":"#/components/schemas/UID"},"orderNumber":{"description":"Order number for the order","type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"},"type":{"$ref":"#/components/schemas/OrderLinkTypeResponseENUM"}},"required":["storeUid","orderUid","orderNumber","orderItemUid","type"],"title":"OrderLinkTypeSchema","type":"object"},"OrderLinkTypeResponseENUM":{"description":"Describes the type of link on an order product item\n\n|ENUM | Description |\n| --- | --- |\n| CREDIT | Reference is a credit link|\n| INSURANCE | Reference to orderline with product to insure|\n| INSURED | Reference to orderline with insurance |\n| COMPENSATION | Reference to orderline with product to compensate|\n| COMPENSATED | Reference to orderline with compensation |\n| PACKAGE | Reference to orderline with main package product |\n| PACKAGE_COMPONENT | Reference to orderline with package component product |\n| SERVICE | Reference to orderline that is a service product |\n| HAS_SERVICE | Reference to orderline that points to a service product |\n| FREIGHT_SERVICE | Reference to orderline that is a freight service product |\n| HAS_FREIGHT_SERVICE | Reference to orderline that points to a freight service product |\n| AUTO_ADD | Reference to orderline that has been automatically added |\n","enum":["CREDIT","INSURANCE","INSURED","COMPENSATION","COMPENSATED","PACKAGE","PACKAGE_COMPONENT","SERVICE","HAS_SERVICE","FREIGHT_SERVICE","HAS_FREIGHT_SERVICE","AUTO_ADD"],"title":"OrderLinkTypeResponseENUM","type":"string"},"ProductTypeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| STOCK | Price*quantity|\n| NO_STOCK | No quantity|\n| CONFIGURABLE | Master configurable product|\n| FLOWGIFTCARD | Flow Giftcard product|\n| PAYEX_GIFTCARD | Payex Giftcard product|\n| NON_PHYSICAL | Non physical product|\n| PACKAGE_FIXED | Packaged product with fixed content|\n| PACKAGE_DYNAMIC | Packaged product with dynamic content|","enum":["STOCK","NO_STOCK","CONFIGURABLE","FLOWGIFTCARD","PAYEX_GIFTCARD","NON_PHYSICAL","PACKAGE_FIXED","PACKAGE_DYNAMIC"],"minLength":1,"title":"ProductTypeENUM","type":"string"},"OrderProductLinePropertyResponseSchema":{"allOf":[{"properties":{"uid":{"$ref":"#/components/schemas/UID"}},"required":["uid"],"type":"object"},{"$ref":"#/components/schemas/OrderProductLinePropertySchema"}],"title":"OrderProductLinePropertyResponseSchema"},"OrderProductLinePropertySchema":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"],"title":"OrderProductLinePropertySchema","type":"object"},"ProductPropertyResponseSchema":{"title":"ProductPropertyResponseSchema","type":"object","required":["productPropertyUid","propertyName","propertyOptionName","propertyType","propertyUid","propertyOptionUid","required"],"properties":{"productPropertyUid":{"$ref":"#/components/schemas/UID"},"propertyName":{"type":"string"},"propertyOptionName":{"type":"string"},"propertyType":{"$ref":"#/components/schemas/PropertyTypeENUM"},"propertyText":{"type":"string","description":"Only in use with TEXT properties."},"propertyUid":{"$ref":"#/components/schemas/UID"},"propertyOptionUid":{"$ref":"#/components/schemas/UID"},"required":{"type":"boolean"}}},"PropertyTypeENUM":{"description":"Describes the type of property a product can have.\n\n|ENUM      | Description |\n| ---------------- | ------------ |\n| TEXT | A single text line such as an URL to a product manual or a reminder to the cashier/salesperson.|\n| SINGLESELECT | A list of values where a product can only have one at any given time.|\n| MULTISELECT | A list of values where a product can have none or several at any given time.|","enum":["TEXT","SINGLESELECT","MULTISELECT"],"title":"PropertyTypeENUM","type":"string"},"CoverImageSchema":{"title":"CoverImageSchema","type":"object","properties":{"productMediaUid":{"$ref":"#/components/schemas/UID"},"mainUrl":{"type":"string"},"thumbnailUrl":{"type":"string"}},"required":["productMediaUid","mainUrl","thumbnailUrl"]},"AllowDeliveryENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| YES | Allow the product to be delivered|\n| NO | Do not allow the product to be delivered|\n| NOT_BEFORE_DATE | Do not allow the product to be delivered before a specified date|","enum":["YES","NO","NOT_BEFORE_DATE"],"title":"AllowDeliveryENUM","type":"string"},"SalesReservationTypeENUM":{"title":"SalesReservationTypeENUM","type":"string","enum":["NONE","WAREHOUSE","PURCHASEORDER","REQUEST_PURCHASEORDER","PURCHASEORDER_CONFIRMED"],"description":""},"SalesReservationDetailsSchema":{"title":"SalesReservationDetailsSchema","type":"object","properties":{"warehouse":{"$ref":"#/components/schemas/SalesReservationWarehouseSchema"},"purchaseOrder":{"$ref":"#/components/schemas/SalesReservationPurchaseOrderSchema"},"receivement":{"$ref":"#/components/schemas/SalesReservationReceivementSchema"}}},"SalesReservationWarehouseSchema":{"title":"SalesReservationWarehouseSchema","type":"object","nullable":true,"required":["warehouseName"],"properties":{"warehouseName":{"type":"string"}}},"SalesReservationPurchaseOrderSchema":{"title":"SalesReservationPurchaseOrderSchema","type":"object","nullable":true,"required":["purchaseOrderUid","purchaseOrderItemUid","purchaseOrderNumber","quantityOrdered"],"properties":{"purchaseOrderUid":{"$ref":"#/components/schemas/UID"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"expectedDeliveryDate":{"type":"string","format":"date-time"},"purchaseOrderNumber":{"type":"string"},"quantityOrdered":{"type":"integer","description":"The quantity ordered on this purchase order line."},"externalId":{"type":"string"}}},"SalesReservationReceivementSchema":{"title":"SalesReservationReceivementSchema","type":"object","required":["receivementUid","receivementItemUid","expectedArrival","quantity","supplierOrderReference","receivedAt"],"properties":{"receivementUid":{"$ref":"#/components/schemas/UID"},"receivementItemUid":{"$ref":"#/components/schemas/UID"},"expectedArrival":{"type":"string","format":"date-time"},"expectedDispatch":{"type":"string","format":"date-time"},"quantity":{"type":"integer"},"supplierOrderReference":{"type":"string"},"receivedAt":{"type":"string","format":"date-time","nullable":true}}},"ProductGtinSchema":{"properties":{"gtin":{"type":"string"},"primary":{"type":"boolean"},"type":{"type":"string"}},"title":"ProductGtinSchema","type":"object"},"OrderOrderStateENUM":{"description":"|ENUM | Description |\n| --- | --- |\n| OPEN | Order is open and beeing edited by someone|\n| PARKED | Order is parked|\n| CANCELED | Order is canceled/deleted|\n| COMPLETE | Order is complete|\n| CONFIRMED | Order is confirmed|\n","enum":["OPEN","PARKED","CANCELED","COMPLETE","CONFIRMED"],"title":"OrderOrderStateENUM","type":"string"},"OrderTotalsResponseSchema":{"description":"","properties":{"costTotal":{"type":"integer"},"grandTotal":{"type":"integer"},"grossProfitAmount":{"description":"Sum of all totalGrossProfitAmount on each product item.","type":"integer"},"grossProfitPercentage":{"description":"","type":"integer"},"specifiedVat":{"items":{"$ref":"#/components/schemas/OrderTotalsVatSpecificationSchema"},"type":"array"},"subtotal":{"type":"integer"},"totalDiscount":{"type":"integer"},"totalVat":{"type":"integer"}},"required":["subtotal","totalDiscount","specifiedVat","totalVat","grandTotal","grossProfitAmount","grossProfitPercentage","costTotal"],"title":"OrderTotals","type":"object"},"OrderTotalsVatSpecificationSchema":{"description":"","properties":{"vatAmount":{"description":"Total amount with this vatRate.","type":"integer"},"vatDescription":{"description":"Description of vat rate.","type":"string"},"vatRate":{"description":"VatRate in percentage.","type":"integer"}},"required":["vatRate","vatAmount","vatDescription"],"title":"OrderTotalsVatSpecificationSchema","type":"object"},"HandlingStateENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NOT_STARTED | Handling has not been started. |\n| IN_PROGRESS | Handling is in progress. |\n| ON_HOLD | Handling is paused (on hold). |\n| COMPLETE | Handling is complete. |","enum":["NOT_STARTED","IN_PROGRESS","ON_HOLD","COMPLETE"],"title":"HandlingStateENUM","type":"string"},"OrderHandlingResponseSchema":{"properties":{"active":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"description":{"type":"string"},"handlingUid":{"$ref":"#/components/schemas/UID"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"name":{"maxLength":20,"type":"string"},"orderHandlingUid":{"$ref":"#/components/schemas/UID"},"state":{"$ref":"#/components/schemas/HandlingStateENUM"}},"required":["orderHandlingUid","handlingUid","active","description","name","state","createdAt","createdBy","lastModifiedAt","lastModifiedBy"],"title":"OrderHandlingResponseSchema","type":"object"},"OrderSettleStateENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NOT_STARTED | Settlement not started|\n| IN_PROGRESS | Settlement is in progress and the order cannot be changed|\n| COMPLETE | Settlement is complete|","enum":["NOT_STARTED","IN_PROGRESS","COMPLETE"],"title":"OrderSettleStateENUM","type":"string"},"OrderSettlementTotalsSchema":{"title":"OrderSettlementTotalsSchema","type":"object","required":["change","remaining","remainingRounded","totals","remainingPrePayment","remainingAuthorizedAmount"],"properties":{"change":{"description":"Total change amount returned to customer.","type":"integer"},"remaining":{"type":"integer","description":"Remaining amount to be paid "},"remainingRounded":{"description":"Rounded value of remaining amount. For use with CASH","type":"integer"},"totals":{"type":"integer","description":"Sum of all approved settlements"},"remainingPrePayment":{"type":"integer"},"remainingAuthorizedAmount":{"type":"integer","description":"Authorized amount available for capture."}}},"SettlementResponseSchema":{"title":"SettlementResponseSchema","type":"object","required":["amount","createdAt","displayMessages","externalId","externalPaymentReference","idMethod","lastModifiedAt","parameters","settlementCode","settlementUid","settlementName","state","status","storeSettlementIssuer","tenantUserDisplayName","tenantUserUid","storePaymentMethodUid","currency","additionalDetails","creditCount","creditAmount","paymentCount","paymentAmount","storeUid","storeName","orderReceiptUid","transactions","receiptText"],"properties":{"amount":{"type":"integer"},"createdAt":{"format":"date-time","type":"string"},"displayMessages":{"type":"array","items":{"$ref":"#/components/schemas/SettlementDisplayMessageSchema"}},"externalId":{"type":"string"},"externalPaymentReference":{"type":"string","description":"The external payment reference for this settlement.\nFor invoices, this could contain the KID"},"idMethod":{"$ref":"#/components/schemas/SettlementIdMethodENUM"},"lastModifiedAt":{"format":"date-time","type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"ledgerType":{"$ref":"#/components/schemas/LedgerTypeENUM"},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/SettlementParameterResponseSchema"}},"settledAt":{"format":"date-time","type":"string"},"settlementCode":{"type":"string"},"settlementUid":{"$ref":"#/components/schemas/UID"},"settlementName":{"type":"string"},"state":{"$ref":"#/components/schemas/SettlementStateENUM"},"status":{"$ref":"#/components/schemas/SettlementStatusENUM"},"storeSettlementIssuer":{"$ref":"#/components/schemas/storeSettlementIssuerSchema"},"tenantUserDisplayName":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"storePaymentMethodUid":{"$ref":"#/components/schemas/UID"},"currency":{"$ref":"#/components/schemas/SettlementCurrencySchema"},"additionalDetails":{"type":"array","items":{"$ref":"#/components/schemas/SettlementAdditionalDetailsSchema"}},"creditCount":{"type":"integer","description":"Number of credits on this settlement. Only applicable for invoice"},"creditAmount":{"type":"integer","description":"The total amount credited. Only applicable for invoice"},"paymentCount":{"type":"integer","description":"Number of payments on this settlement. Only applicable for invoice"},"paymentAmount":{"type":"integer","description":"The total amount of payments. Only applicable for invoice"},"tillUid":{"$ref":"#/components/schemas/OptionalUID"},"tillName":{"type":"string","description":"Display name of the till where the payment was registered."},"tillNumber":{"type":"integer","description":"Till register number where the payment was registered."},"storeUid":{"$ref":"#/components/schemas/OptionalUID"},"storeName":{"type":"string","description":"Display name of the store where the payment was registered."},"orderReceiptUid":{"$ref":"#/components/schemas/OptionalUID"},"authorizedAmount":{"type":"integer","description":"The total authorized amount on this settlement, calculated from authorize transactions."},"capturedAmount":{"type":"integer","description":"The total captured amount on this settlement, calculated from capture transactions."},"refundedAmount":{"type":"integer","description":"The total refunded amount on this settlement, calculated from refund transactions."},"receiptText":{"type":"string","maxLength":500,"description":"Text printed on the receipt for this payment method when configured on the tenant payment method. Empty when not set, when suppressed for this settlement type (e.g. store credit, gift cards), or when cleared."},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/SettlementTransactionSchema"}}}},"SettlementDisplayMessageSchema":{"description":"Settlement display messages","properties":{"key":{"type":"string"},"message":{"type":"string"},"timestamp":{"format":"date-time","type":"string"}},"required":["key","message","timestamp"],"title":"SettlementDisplayMessageSchema","type":"object"},"SettlementIdMethodENUM":{"enum":["NO_CVM_RULE_PERFORMED","SIGNATURE","PIN_ONLINE","PIN_OFFLINE","PIN_ONLINE_AND_SIGNATURE","PIN_OFFLINE_AND_SIGNATURE","NO_CVM","FAILED","ON_DEVICE","REFUND"],"title":"SettlementIdMethodENUM","type":"string"},"LedgerTypeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n|LEDGER | Ledger |\n|GENERAL_LEDGER | General ledger |\n|CUSTOMER_LEDGER | Customer ledger |","enum":["LEDGER","GENERAL_LEDGER","CUSTOMER_LEDGER"],"title":"LedgerTypeENUM","type":"string"},"SettlementParameterResponseSchema":{"description":"settlement parameters response","title":"SettlementParameterResponseSchema","type":"object","required":["key","value","name","type"],"properties":{"key":{"type":"string"},"value":{"type":"string"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/TenantPaymentMethodParameterTypeENUM"}}},"TenantPaymentMethodParameterTypeENUM":{"title":"TenantPaymentMethodParameterTypeENUM","type":"string","enum":["TEXT","INTEGER","NUMERIC","DATE","MOBILE","MODULUS10","MODULUS11"]},"SettlementStateENUM":{"enum":["NOT_STARTED","IN_PROGRESS","COMPLETE","TERMINATED"],"title":"SettlementCodeENUM","type":"string"},"SettlementStatusENUM":{"enum":["NEW","PROCESSING","AUTHORIZED","CAPTURED","REFUNDED","PARTIALLY_REFUNDED","PENDING_REFUND","FAILED","CANCELLED_BY_MERCHANT","CANCELLED_BY_USER","CANCELLED_FORCE","DELETED","DENIED","REJECTED"],"title":"SettlementCodeENUM","type":"string"},"storeSettlementIssuerSchema":{"title":"storeSettlementIssuerSchema","type":"object","description":"Settlement issuer information","required":["storeSettlementIssuerUid","name","code"],"properties":{"storeSettlementIssuerUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string","description":"The name of the settlement issuer"},"code":{"type":"string","description":"The code of the settlement issuer"}}},"SettlementCurrencySchema":{"title":"SettlementCurrencySchema","type":"object","required":["amount","code","exchangeRate"],"properties":{"amount":{"type":"integer"},"code":{"type":"string"},"exchangeRate":{"type":"integer"}}},"SettlementAdditionalDetailsSchema":{"title":"SettlementAdditionalDetailsSchema","type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}},"SettlementTransactionSchema":{"title":"SettlementTransactionSchema","type":"object","required":["transactionType","transactionAmount","orderReceiptUid"],"properties":{"transactionType":{"type":"string"},"pspTransactionId":{"type":"string"},"transactionAmount":{"type":"integer"},"orderReceiptUid":{"$ref":"#/components/schemas/OptionalUID"}}},"OrderTypeENUM":{"enum":["OFFER","ORDER","PAYMENT"],"title":"OrderTypeENUM","type":"string"},"VatPrintENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n|SUM| Print as a part of orderlines.|\n|SEPARATE| Print as a separate field.|\n","enum":["SUM","SEPARATE"],"title":"vatPrintENUM","type":"string"},"OrderDiscountResponseSchema":{"title":"OrderDiscountResponseSchema","type":"object","required":["orderDiscountUid","discountCode","type","amount","name","origin","validTo","maxUsage","productSkus","orderItemUids","externalTransactionId","scope","discountReasonCode","discountReference","createdAt","createdBy","lastModifiedAt","lastModifiedBy","campaignUid"],"properties":{"orderDiscountUid":{"$ref":"#/components/schemas/UID"},"discountCode":{"type":"string"},"type":{"$ref":"#/components/schemas/DiscountTypeENUM"},"amount":{"type":"integer"},"name":{"type":"string"},"origin":{"$ref":"#/components/schemas/DiscountOriginENUM"},"validTo":{"type":"string","format":"date-time"},"maxUsage":{"type":"integer"},"productSkus":{"type":"array","items":{"type":"string"}},"orderItemUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"externalTransactionId":{"type":"string"},"scope":{"$ref":"#/components/schemas/DiscountScopeENUM"},"discountReasonCode":{"type":"string"},"discountReference":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"lastModifiedAt":{"type":"string","format":"date-time"},"lastModifiedBy":{"type":"string"},"campaignUid":{"$ref":"#/components/schemas/OptionalUID"}}},"DiscountTypeENUM":{"title":"DiscountTypeENUM","type":"string","enum":["PERCENTAGE","AMOUNT"]},"DiscountOriginENUM":{"title":"DiscountOriginENUM","type":"string","enum":["LOYALTY","MANUAL","PRICEREDUCTION","CAMPAIGN"]},"DiscountScopeENUM":{"title":"DiscountScopeENUM","type":"string","enum":["WHOLE_ORDER","SPECIFIC_LINE","PRODUCT_LIST","SPECIFIC_LINE_LIST"]},"AllowedOrderActionENUM":{"enum":["DELETE","OFFER","LOYALTY_POINTS"],"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| DELETE | Order can be deleted|\n| OFFER | Order can be changed to an offer|\n| LOYALTY_POINTS | Order has loyalty points|"},"OrderSettlementCreateSchema":{"description":"Create a new settlement","title":"OrderSettlementCreateSchema","type":"object","required":["amount","storePaymentMethodUid"],"properties":{"amount":{"description":"in cents, e.g. 1,50 as 150","type":"integer"},"deviceIdentifier":{"type":"string"},"externalId":{"description":"External reference for the settlement","type":"string"},"parameters":{"description":"Refer to each payment type's options for available parameters, e.g. 'mobile' for VIPPS.","type":"array","items":{"$ref":"#/components/schemas/SettlementParameterRequestSchema"}},"storePaymentMethodUid":{"$ref":"#/components/schemas/OptionalUID"},"settlementUid":{"$ref":"#/components/schemas/UID"}}},"SettlementParameterRequestSchema":{"description":"settlement parameters request","title":"SettlementParameterRequestSchema","type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"requestBodies":{"OrderSettlementCreateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderSettlementCreateSchema"}}}}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/orders/{orderUid}/settlements/{settlementUid}/payment-settlements":{"post":{"summary":"Create new payment-settlement","tags":["OrderSettlement"],"responses":{"201":{"$ref":"#/components/responses/OrderResponse"}},"operationId":"post-settlements-payment-settlements","description":"A payment belongs to an order settlement with payment method `INVOICE`.\nNormally invoices are paid via bank and the payments imported or also registered by hand.\nBut if a customer pays the invoice by another method in store (e.g. cash or card) \nit is made as a settlement on a new order without any lines, and this is what we do here, \nmeaning the path parameters must refer to the order and settlement for which this is a payment.\n\nRequired permissions: PAYMENT","requestBody":{"$ref":"#/components/requestBodies/OrderSettlementCreateRequest"}}}}}
```

## Search in settlements

> Retrieves a filtered list of settlements for the organization.  \
> Results are sorted by \`createdAt\` in descending order when no sorting parameter is specified.  \
> The spreadsheet response is a report containing only key settlement fields\
> (pagination does not apply to spreadsheet responses).

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"OrderSettlement","description":"OrderSettlement"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"SettlementListResponse":{"content":{"application/json":{"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SettlementResponseSchema"},"type":"array"},"paging":{"$ref":"#/components/schemas/Paging"}},"required":["items","paging"],"type":"object"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}},"description":"Example response"}},"schemas":{"SettlementResponseSchema":{"title":"SettlementResponseSchema","type":"object","required":["amount","createdAt","displayMessages","externalId","externalPaymentReference","idMethod","lastModifiedAt","parameters","settlementCode","settlementUid","settlementName","state","status","storeSettlementIssuer","tenantUserDisplayName","tenantUserUid","storePaymentMethodUid","currency","additionalDetails","creditCount","creditAmount","paymentCount","paymentAmount","storeUid","storeName","orderReceiptUid","transactions","receiptText"],"properties":{"amount":{"type":"integer"},"createdAt":{"format":"date-time","type":"string"},"displayMessages":{"type":"array","items":{"$ref":"#/components/schemas/SettlementDisplayMessageSchema"}},"externalId":{"type":"string"},"externalPaymentReference":{"type":"string","description":"The external payment reference for this settlement.\nFor invoices, this could contain the KID"},"idMethod":{"$ref":"#/components/schemas/SettlementIdMethodENUM"},"lastModifiedAt":{"format":"date-time","type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"ledgerType":{"$ref":"#/components/schemas/LedgerTypeENUM"},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/SettlementParameterResponseSchema"}},"settledAt":{"format":"date-time","type":"string"},"settlementCode":{"type":"string"},"settlementUid":{"$ref":"#/components/schemas/UID"},"settlementName":{"type":"string"},"state":{"$ref":"#/components/schemas/SettlementStateENUM"},"status":{"$ref":"#/components/schemas/SettlementStatusENUM"},"storeSettlementIssuer":{"$ref":"#/components/schemas/storeSettlementIssuerSchema"},"tenantUserDisplayName":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"storePaymentMethodUid":{"$ref":"#/components/schemas/UID"},"currency":{"$ref":"#/components/schemas/SettlementCurrencySchema"},"additionalDetails":{"type":"array","items":{"$ref":"#/components/schemas/SettlementAdditionalDetailsSchema"}},"creditCount":{"type":"integer","description":"Number of credits on this settlement. Only applicable for invoice"},"creditAmount":{"type":"integer","description":"The total amount credited. Only applicable for invoice"},"paymentCount":{"type":"integer","description":"Number of payments on this settlement. Only applicable for invoice"},"paymentAmount":{"type":"integer","description":"The total amount of payments. Only applicable for invoice"},"tillUid":{"$ref":"#/components/schemas/OptionalUID"},"tillName":{"type":"string","description":"Display name of the till where the payment was registered."},"tillNumber":{"type":"integer","description":"Till register number where the payment was registered."},"storeUid":{"$ref":"#/components/schemas/OptionalUID"},"storeName":{"type":"string","description":"Display name of the store where the payment was registered."},"orderReceiptUid":{"$ref":"#/components/schemas/OptionalUID"},"authorizedAmount":{"type":"integer","description":"The total authorized amount on this settlement, calculated from authorize transactions."},"capturedAmount":{"type":"integer","description":"The total captured amount on this settlement, calculated from capture transactions."},"refundedAmount":{"type":"integer","description":"The total refunded amount on this settlement, calculated from refund transactions."},"receiptText":{"type":"string","maxLength":500,"description":"Text printed on the receipt for this payment method when configured on the tenant payment method. Empty when not set, when suppressed for this settlement type (e.g. store credit, gift cards), or when cleared."},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/SettlementTransactionSchema"}}}},"SettlementDisplayMessageSchema":{"description":"Settlement display messages","properties":{"key":{"type":"string"},"message":{"type":"string"},"timestamp":{"format":"date-time","type":"string"}},"required":["key","message","timestamp"],"title":"SettlementDisplayMessageSchema","type":"object"},"SettlementIdMethodENUM":{"enum":["NO_CVM_RULE_PERFORMED","SIGNATURE","PIN_ONLINE","PIN_OFFLINE","PIN_ONLINE_AND_SIGNATURE","PIN_OFFLINE_AND_SIGNATURE","NO_CVM","FAILED","ON_DEVICE","REFUND"],"title":"SettlementIdMethodENUM","type":"string"},"LedgerTypeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n|LEDGER | Ledger |\n|GENERAL_LEDGER | General ledger |\n|CUSTOMER_LEDGER | Customer ledger |","enum":["LEDGER","GENERAL_LEDGER","CUSTOMER_LEDGER"],"title":"LedgerTypeENUM","type":"string"},"SettlementParameterResponseSchema":{"description":"settlement parameters response","title":"SettlementParameterResponseSchema","type":"object","required":["key","value","name","type"],"properties":{"key":{"type":"string"},"value":{"type":"string"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/TenantPaymentMethodParameterTypeENUM"}}},"TenantPaymentMethodParameterTypeENUM":{"title":"TenantPaymentMethodParameterTypeENUM","type":"string","enum":["TEXT","INTEGER","NUMERIC","DATE","MOBILE","MODULUS10","MODULUS11"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"SettlementStateENUM":{"enum":["NOT_STARTED","IN_PROGRESS","COMPLETE","TERMINATED"],"title":"SettlementCodeENUM","type":"string"},"SettlementStatusENUM":{"enum":["NEW","PROCESSING","AUTHORIZED","CAPTURED","REFUNDED","PARTIALLY_REFUNDED","PENDING_REFUND","FAILED","CANCELLED_BY_MERCHANT","CANCELLED_BY_USER","CANCELLED_FORCE","DELETED","DENIED","REJECTED"],"title":"SettlementCodeENUM","type":"string"},"storeSettlementIssuerSchema":{"title":"storeSettlementIssuerSchema","type":"object","description":"Settlement issuer information","required":["storeSettlementIssuerUid","name","code"],"properties":{"storeSettlementIssuerUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string","description":"The name of the settlement issuer"},"code":{"type":"string","description":"The code of the settlement issuer"}}},"SettlementCurrencySchema":{"title":"SettlementCurrencySchema","type":"object","required":["amount","code","exchangeRate"],"properties":{"amount":{"type":"integer"},"code":{"type":"string"},"exchangeRate":{"type":"integer"}}},"SettlementAdditionalDetailsSchema":{"title":"SettlementAdditionalDetailsSchema","type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"SettlementTransactionSchema":{"title":"SettlementTransactionSchema","type":"object","required":["transactionType","transactionAmount","orderReceiptUid"],"properties":{"transactionType":{"type":"string"},"pspTransactionId":{"type":"string"},"transactionAmount":{"type":"integer"},"orderReceiptUid":{"$ref":"#/components/schemas/OptionalUID"}}},"Paging":{"description":"totalCount The total number of items in the result set.\n\npageSize The number of items per page.\n\npageNumber The current page in the result set.","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"}},"required":["totalCount","pageSize","pageNumber"],"title":"Paging","type":"object"},"DateTimeRangeSchema":{"title":"DateTimeRangeSchema","type":"object","required":["from","to"],"properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}}},"SortDirectionENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ASC | Sort in ascending order|\n| DESC | Sort in descending order|\n","enum":["ASC","DESC"],"title":"SortDirectionENUM","type":"string"}},"requestBodies":{"SettlementSearchRequest":{"content":{"application/json":{"schema":{"type":"object","properties":{"storeUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"storePaymentMethodUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"settlementCode":{"type":"string"},"createdAt":{"$ref":"#/components/schemas/DateTimeRangeSchema"},"states":{"type":"array","items":{"$ref":"#/components/schemas/SettlementStateENUM"}},"statuses":{"type":"array","items":{"$ref":"#/components/schemas/SettlementStatusENUM"}},"externalIds":{"type":"array","items":{"type":"string"}},"externalPaymentReferences":{"type":"array","items":{"type":"string"}},"hasEhfInvoice":{"type":"boolean","description":"EHF = \"Elektronisk handelsformat\""},"hasPaymentBalanceOutstanding":{"type":"boolean"}}}}}}},"parameters":{"pageNumberQuery":{"description":"Reference to a specific page in a result set.","in":"query","name":"pageNumber","required":false,"schema":{"type":"integer"}},"pageSizeQuery":{"description":"The number of items per page in a result set.","in":"query","name":"pageSize","required":false,"schema":{"type":"integer"}},"sortByQuery":{"description":"Defines which field the resource list is sorted by.","in":"query","name":"sortBy","required":false,"schema":{"type":"string"}},"sortDirectionQuery":{"description":"Reference to a sort direction","explode":false,"in":"query","name":"sortDirection","schema":{"$ref":"#/components/schemas/SortDirectionENUM"},"style":"form"}}},"paths":{"/tenants/{tenantUid}/organizations/{organizationUid}/settlements/search":{"post":{"summary":"Search in settlements","tags":["OrderSettlement"],"responses":{"200":{"$ref":"#/components/responses/SettlementListResponse"}},"operationId":"post-settlements-search","description":"Retrieves a filtered list of settlements for the organization.  \nResults are sorted by `createdAt` in descending order when no sorting parameter is specified.  \nThe spreadsheet response is a report containing only key settlement fields\n(pagination does not apply to spreadsheet responses).","requestBody":{"$ref":"#/components/requestBodies/SettlementSearchRequest"},"parameters":[{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"}]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flowretail.com/api/ordersettlement.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
