> For the complete documentation index, see [llms.txt](https://help.openloyalty.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.openloyalty.io/api-reference/transactions.md).

# Transactions

These endpoints will allow you to easily manage transactions.

## Get transaction’s details

> \<label style="background-color: #BFE1F6;padding:5px;">Integration\</label>\<br>\<br>\
> This method returns all information about a specific Transaction.<br>

````json
{"openapi":"3.0.0","info":{"title":"Open Loyalty","version":"0.0.1"},"tags":[{"name":"Transactions","description":"These endpoints will allow you to easily manage transactions."}],"servers":[{"url":"http://openloyalty.localhost"}],"security":[{"Bearer":[]},{"token":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","description":"Open Loyalty has the JWT authorization.\nTo learn what a JSON Web Token is and how it works, check out Introduction to JSON Web Tokens <https://jwt.io/introduction/>\n\n### Obtain an access token\n\nSend a request with the parameters username and password\n\n#### Definition\n\n`POST /api/admin/login_check` [Go to definition](#operation/adminLoginCheck)\\\n`POST /api/{storeCode}/member/login_check` [Go to definition](#operation/memberLoginCheck)\n\n#### Example\n\n```bash\ncurl {HOST}/api/admin/login_check\n    -H 'Content-Type: application/json;charset=UTF-8'\n    -H 'Accept: application/json, text/plain, */*'\n    --data-binary '{\"username\":\"admin\",\"password\":\"password\"}'\n```\n\n#### Example Response\n\n```json\n{\n    \"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6...\",\n    \"refresh_token\":\"0558f8bb29948c4e54c443f...\"\n}\n```\n\n### Using JSON Web Token\n\nAdd authorization header to each request\\\n`Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...`\\\nYou can now access any API method you want under the /api prefix.\n\n#### Example\n```bash\ncurl {HOST}/api/{storeCode}/analytics/members\n    -H 'Accept: application/json'\n    -H 'Content-type: application/x-www-form-urlencoded'\n    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...'\n```\n\n### Refresh JSON Web Token\nYou can refresh token using refresh_token that was given during login.\\\nThere are two endpoints\\\nTo refresh admin token `POST /api/token/refresh` [Go to definition](#operation/tokenRefresh)\\\nTo refresh member token `POST /api/{storeCode}/token/refresh` [Go to definition](#operation/tokenRefreshMember)\n","name":"Authorization","in":"header","bearerFormat":"JWT","scheme":"bearer"},"token":{"type":"apiKey","name":"X-AUTH-TOKEN","in":"header"}},"parameters":{"storeCode":{"name":"storeCode","in":"path","description":"Store code","required":true,"schema":{"type":"string"}},"transaction":{"name":"transaction","in":"path","description":"Transaction ID","required":true,"schema":{"type":"string","format":"uuid"}}},"schemas":{"Transaction":{"properties":{"grossValue":{"type":"number","format":"float"},"metrics":{"type":"array","items":{"properties":{"name":{"type":"string"},"value":{"type":"number","format":"float"},"calculatedAt":{"format":"date-time"}},"type":"object"}},"transactionId":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"customerData":{"properties":{"customerId":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"name":{"type":"string"},"nip":{"type":"string"},"phone":{"type":"string"},"loyaltyCardNumber":{"type":"string"},"address":{"$ref":"#/components/schemas/CustomerAddressFormType"}},"type":"object"},"items":{"type":"array","items":{"properties":{"name":{"type":"string"},"quantity":{"description":"The quantity of the product. This field is required if 'highPrecisionQuantity' is not provided. It is recommended to use 'highPrecisionQuantity', as 'quantity' is deprecated.","type":"integer","deprecated":true},"highPrecisionQuantity":{"description":"The precise quantity of the product, with a maximum of 3 decimal places. This field is required if 'quantity' is not provided.","type":"number","format":"float"},"grossValue":{"type":"number","format":"float"},"category":{"type":"string"},"labels":{"type":"array","items":{"properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","minLength":1}},"type":"object"}},"maker":{"type":"string"},"sku":{"type":"string"}},"type":"object"}},"header":{"properties":{"documentNumber":{"description":"Specifies the document number used in the transaction.","type":"string"},"documentType":{"type":"string","enum":["sell","return"]},"linkedDocumentNumber":{"description":"Field is used with “documentType”: “return”","type":"string"},"purchasedAt":{"type":"string","format":"date-time"},"purchasePlace":{"type":"string"},"excludedDeliverySKUs":{"type":"array","items":{}},"excludedSKUs":{"type":"array","items":{}},"excludedCategories":{"type":"array","items":{}},"labels":{"type":"array","items":{}}},"type":"object"},"matched":{"type":"boolean"},"currency":{"type":"string"},"pointsEarned":{"type":"integer"},"unitsDeducted":{"type":"integer"},"channelId":{"type":"string","format":"uuid"},"channelName":{"type":"string"},"assignedToCustomerAt":{"type":"string","format":"date-time","nullable":true}},"type":"object"},"CustomerAddressFormType":{"properties":{"street":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"postal":{"type":"string"},"city":{"type":"string"},"province":{"type":"string"},"country":{"description":"The country code in ISO 3166-1 alpha-2 format. This should be a two-letter uppercase string representing a valid country code. Examples:  - `US` (United States) - `PL` (Poland)","type":"string"}},"type":"object"}},"responses":{"AccessDenied":{"description":"Forbidden.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}},"NotFound":{"description":"Not found.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}}}},"paths":{"/api/{storeCode}/transaction/{transaction}":{"get":{"tags":["Transactions"],"summary":"Get transaction’s details","description":"<label style=\"background-color: #BFE1F6;padding:5px;\">Integration</label><br><br>\nThis method returns all information about a specific Transaction.\n","operationId":"transactionGet","parameters":[{"$ref":"#/components/parameters/storeCode"},{"$ref":"#/components/parameters/transaction"}],"responses":{"200":{"description":"Transaction details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transaction"}}}},"403":{"$ref":"#/components/responses/AccessDenied"},"404":{"$ref":"#/components/responses/NotFound"}}}}}}
````

## Update transaction’s details

> \<label style="background-color: #BFE1F6;padding:5px;">Integration\</label>\<br>\<br>\
> This method allows updating data about a specific Transaction.<br>

````json
{"openapi":"3.0.0","info":{"title":"Open Loyalty","version":"0.0.1"},"tags":[{"name":"Transactions","description":"These endpoints will allow you to easily manage transactions."}],"servers":[{"url":"http://openloyalty.localhost"}],"security":[{"Bearer":[]},{"token":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","description":"Open Loyalty has the JWT authorization.\nTo learn what a JSON Web Token is and how it works, check out Introduction to JSON Web Tokens <https://jwt.io/introduction/>\n\n### Obtain an access token\n\nSend a request with the parameters username and password\n\n#### Definition\n\n`POST /api/admin/login_check` [Go to definition](#operation/adminLoginCheck)\\\n`POST /api/{storeCode}/member/login_check` [Go to definition](#operation/memberLoginCheck)\n\n#### Example\n\n```bash\ncurl {HOST}/api/admin/login_check\n    -H 'Content-Type: application/json;charset=UTF-8'\n    -H 'Accept: application/json, text/plain, */*'\n    --data-binary '{\"username\":\"admin\",\"password\":\"password\"}'\n```\n\n#### Example Response\n\n```json\n{\n    \"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6...\",\n    \"refresh_token\":\"0558f8bb29948c4e54c443f...\"\n}\n```\n\n### Using JSON Web Token\n\nAdd authorization header to each request\\\n`Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...`\\\nYou can now access any API method you want under the /api prefix.\n\n#### Example\n```bash\ncurl {HOST}/api/{storeCode}/analytics/members\n    -H 'Accept: application/json'\n    -H 'Content-type: application/x-www-form-urlencoded'\n    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...'\n```\n\n### Refresh JSON Web Token\nYou can refresh token using refresh_token that was given during login.\\\nThere are two endpoints\\\nTo refresh admin token `POST /api/token/refresh` [Go to definition](#operation/tokenRefresh)\\\nTo refresh member token `POST /api/{storeCode}/token/refresh` [Go to definition](#operation/tokenRefreshMember)\n","name":"Authorization","in":"header","bearerFormat":"JWT","scheme":"bearer"},"token":{"type":"apiKey","name":"X-AUTH-TOKEN","in":"header"}},"parameters":{"storeCode":{"name":"storeCode","in":"path","description":"Store code","required":true,"schema":{"type":"string"}},"transaction":{"name":"transaction","in":"path","description":"Transaction ID","required":true,"schema":{"type":"string","format":"uuid"}}},"schemas":{"PostTransaction":{"properties":{"transaction":{"required":["header","items"],"properties":{"customerData":{"properties":{"customerId":{"type":"string"},"address":{"$ref":"#/components/schemas/CustomerAddressFormType"},"email":{"type":"string"},"loyaltyCardNumber":{"type":"string"},"name":{"type":"string"},"nip":{"type":"string"},"phone":{"type":"string"}},"type":"object","additionalProperties":false},"items":{"type":"array","items":{"required":["sku","name","grossValue","category"],"properties":{"category":{"type":"string"},"grossValue":{"type":"number","format":"float"},"maker":{"type":"string"},"name":{"type":"string"},"quantity":{"description":"The quantity of the product. This field is required if 'highPrecisionQuantity' is not provided. It is recommended to use 'highPrecisionQuantity', as 'quantity' is deprecated.","type":"integer","deprecated":true},"highPrecisionQuantity":{"description":"The precise quantity of the product, with a maximum of 3 decimal places. This field is required if 'quantity' is not provided.","type":"number","format":"float"},"sku":{"type":"string"},"labels":{"type":"array","items":{"$ref":"#/components/schemas/TransactionLabelFormType"}}},"type":"object","additionalProperties":false}},"channelId":{"type":"string","format":"uuid"},"header":{"required":["documentNumber","purchasedAt"],"properties":{"documentNumber":{"description":"Specifies the document number used in the transaction.","type":"string"},"linkedDocumentNumber":{"description":"Used only for return transactions and refers to the original ‘sell’ document.","type":"string"},"documentType":{"type":"string","enum":["sell","return"]},"labels":{"type":"array","items":{"$ref":"#/components/schemas/TransactionLabelFormType"}},"purchasedAt":{"type":"string"},"purchasePlace":{"type":"string"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false},"CustomerAddressFormType":{"properties":{"street":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"postal":{"type":"string"},"city":{"type":"string"},"province":{"type":"string"},"country":{"description":"The country code in ISO 3166-1 alpha-2 format. This should be a two-letter uppercase string representing a valid country code. Examples:  - `US` (United States) - `PL` (Poland)","type":"string"}},"type":"object"},"TransactionLabelFormType":{"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"}},"responses":{"NoContent":{"description":"Success. No content."},"BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"required":["code","message","errors"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"errors":{"type":"array","items":{"required":["message","parameters","plural","code","path"],"properties":{"message":{"type":"string"},"parameters":{},"plural":{"type":"integer","nullable":true},"code":{"type":"string"},"path":{"type":"string"}},"type":"object"}}},"type":"object"}}}},"AccessDenied":{"description":"Forbidden.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}},"NotFound":{"description":"Not found.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}}}},"paths":{"/api/{storeCode}/transaction/{transaction}":{"put":{"tags":["Transactions"],"summary":"Update transaction’s details","description":"<label style=\"background-color: #BFE1F6;padding:5px;\">Integration</label><br><br>\nThis method allows updating data about a specific Transaction.\n","operationId":"transactionPut","parameters":[{"$ref":"#/components/parameters/storeCode"},{"$ref":"#/components/parameters/transaction"}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"transaction":{"$ref":"#/components/schemas/PostTransaction"}},"type":"object"}}}},"responses":{"204":{"$ref":"#/components/responses/NoContent"},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/AccessDenied"},"404":{"$ref":"#/components/responses/NotFound"}}}}}}
````

## Get transactions list

> \<label style="background-color: #BFE1F6;padding:5px;">Integration\</label>\<br>\<br>\
> This method returns a list of all Transaction in the system.  \
> If sorting is not chosen, the rows will be returned in an unspecified order.  \
> To sort a result, use an \`\_orderBy\` parameter in query.<br>

````json
{"openapi":"3.0.0","info":{"title":"Open Loyalty","version":"0.0.1"},"tags":[{"name":"Transactions","description":"These endpoints will allow you to easily manage transactions."}],"servers":[{"url":"http://openloyalty.localhost"}],"security":[{"Bearer":[]},{"token":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","description":"Open Loyalty has the JWT authorization.\nTo learn what a JSON Web Token is and how it works, check out Introduction to JSON Web Tokens <https://jwt.io/introduction/>\n\n### Obtain an access token\n\nSend a request with the parameters username and password\n\n#### Definition\n\n`POST /api/admin/login_check` [Go to definition](#operation/adminLoginCheck)\\\n`POST /api/{storeCode}/member/login_check` [Go to definition](#operation/memberLoginCheck)\n\n#### Example\n\n```bash\ncurl {HOST}/api/admin/login_check\n    -H 'Content-Type: application/json;charset=UTF-8'\n    -H 'Accept: application/json, text/plain, */*'\n    --data-binary '{\"username\":\"admin\",\"password\":\"password\"}'\n```\n\n#### Example Response\n\n```json\n{\n    \"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6...\",\n    \"refresh_token\":\"0558f8bb29948c4e54c443f...\"\n}\n```\n\n### Using JSON Web Token\n\nAdd authorization header to each request\\\n`Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...`\\\nYou can now access any API method you want under the /api prefix.\n\n#### Example\n```bash\ncurl {HOST}/api/{storeCode}/analytics/members\n    -H 'Accept: application/json'\n    -H 'Content-type: application/x-www-form-urlencoded'\n    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...'\n```\n\n### Refresh JSON Web Token\nYou can refresh token using refresh_token that was given during login.\\\nThere are two endpoints\\\nTo refresh admin token `POST /api/token/refresh` [Go to definition](#operation/tokenRefresh)\\\nTo refresh member token `POST /api/{storeCode}/token/refresh` [Go to definition](#operation/tokenRefreshMember)\n","name":"Authorization","in":"header","bearerFormat":"JWT","scheme":"bearer"},"token":{"type":"apiKey","name":"X-AUTH-TOKEN","in":"header"}},"parameters":{"storeCode":{"name":"storeCode","in":"path","description":"Store code","required":true,"schema":{"type":"string"}},"page":{"name":"_page","in":"query","description":"Number of page with results, starts from 1","required":false,"schema":{"type":"integer","default":1,"minimum":1}},"itemsOnPage":{"name":"_itemsOnPage","in":"query","description":"Items on one page","required":false,"schema":{"type":"integer","default":10,"maximum":50,"minimum":1}},"orderBy":{"name":"_orderBy","in":"query","description":"Sorting order. If sorting is not chosen, the rows will be returned in an unspecified order. Sort order: * `asc` - Ascending, from A to Z * `desc` - Descending, from Z to A","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":{"type":"string","enum":["asc","desc"]}}},"scroll":{"name":"_scroll","in":"query","description":"To use scroll pagination, add the `_scroll` parameter to your query:\n  ?_scroll\n\nTo retrieve the next page, take the `scroll` value from the previous response and use it in the next request:\n  ?_scroll=eyJjcmVhdGVkQXQiOiIyMDI1LTA3LTAxIDEzOjU2OjI5LjAyMTcwMyIsImlkIjoiNTM5N2RiYzYtZGVkMi00MTQ0LTlhMjQtOTRjYmI5YWVjNDBjIn0=\n\nNotes:\n  - Scroll pagination does not support sorting with `_orderBy`.\n  - Items are returned in ascending order by the `createdAt` field by default.\n","required":false,"schema":{"type":"string"}}},"schemas":{"Transaction":{"properties":{"grossValue":{"type":"number","format":"float"},"metrics":{"type":"array","items":{"properties":{"name":{"type":"string"},"value":{"type":"number","format":"float"},"calculatedAt":{"format":"date-time"}},"type":"object"}},"transactionId":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"customerData":{"properties":{"customerId":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"name":{"type":"string"},"nip":{"type":"string"},"phone":{"type":"string"},"loyaltyCardNumber":{"type":"string"},"address":{"$ref":"#/components/schemas/CustomerAddressFormType"}},"type":"object"},"items":{"type":"array","items":{"properties":{"name":{"type":"string"},"quantity":{"description":"The quantity of the product. This field is required if 'highPrecisionQuantity' is not provided. It is recommended to use 'highPrecisionQuantity', as 'quantity' is deprecated.","type":"integer","deprecated":true},"highPrecisionQuantity":{"description":"The precise quantity of the product, with a maximum of 3 decimal places. This field is required if 'quantity' is not provided.","type":"number","format":"float"},"grossValue":{"type":"number","format":"float"},"category":{"type":"string"},"labels":{"type":"array","items":{"properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","minLength":1}},"type":"object"}},"maker":{"type":"string"},"sku":{"type":"string"}},"type":"object"}},"header":{"properties":{"documentNumber":{"description":"Specifies the document number used in the transaction.","type":"string"},"documentType":{"type":"string","enum":["sell","return"]},"linkedDocumentNumber":{"description":"Field is used with “documentType”: “return”","type":"string"},"purchasedAt":{"type":"string","format":"date-time"},"purchasePlace":{"type":"string"},"excludedDeliverySKUs":{"type":"array","items":{}},"excludedSKUs":{"type":"array","items":{}},"excludedCategories":{"type":"array","items":{}},"labels":{"type":"array","items":{}}},"type":"object"},"matched":{"type":"boolean"},"currency":{"type":"string"},"pointsEarned":{"type":"integer"},"unitsDeducted":{"type":"integer"},"channelId":{"type":"string","format":"uuid"},"channelName":{"type":"string"},"assignedToCustomerAt":{"type":"string","format":"date-time","nullable":true}},"type":"object"},"CustomerAddressFormType":{"properties":{"street":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"postal":{"type":"string"},"city":{"type":"string"},"province":{"type":"string"},"country":{"description":"The country code in ISO 3166-1 alpha-2 format. This should be a two-letter uppercase string representing a valid country code. Examples:  - `US` (United States) - `PL` (Poland)","type":"string"}},"type":"object"},"SearchableTotalResponse":{"required":["all","filtered","estimated"],"properties":{"all":{"type":"integer","deprecated":true},"filtered":{"type":"integer","deprecated":true},"estimated":{"description":"Field estimated is used to show that the results are estimated. It might happen when there are more than 5000 results due to performance optimization.","type":"boolean","deprecated":true}},"type":"object","deprecated":true}},"responses":{"BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"required":["code","message","errors"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"errors":{"type":"array","items":{"required":["message","parameters","plural","code","path"],"properties":{"message":{"type":"string"},"parameters":{},"plural":{"type":"integer","nullable":true},"code":{"type":"string"},"path":{"type":"string"}},"type":"object"}}},"type":"object"}}}},"AccessDenied":{"description":"Forbidden.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}}}},"paths":{"/api/{storeCode}/transaction":{"get":{"tags":["Transactions"],"summary":"Get transactions list","description":"<label style=\"background-color: #BFE1F6;padding:5px;\">Integration</label><br><br>\nThis method returns a list of all Transaction in the system.  \nIf sorting is not chosen, the rows will be returned in an unspecified order.  \nTo sort a result, use an `_orderBy` parameter in query.\n","operationId":"transactionGetList","parameters":[{"$ref":"#/components/parameters/storeCode"},{"name":"transactionId","in":"query","required":false,"schema":{"type":"string"}},{"name":"customerData:customerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"customerData:loyaltyCardNumber","in":"query","required":false,"schema":{"type":"string"}},{"name":"customerData:name","in":"query","required":false,"schema":{"type":"string"}},{"name":"customerData:email","in":"query","required":false,"schema":{"type":"string"}},{"name":"customerData:phone","in":"query","required":false,"schema":{"type":"string"}},{"name":"customerData:nip","in":"query","required":false,"schema":{"type":"string"}},{"name":"customerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"header:documentType","in":"query","required":false,"schema":{"type":"string"}},{"name":"header:documentNumber","in":"query","description":"Specifies the document number used in the transaction.","required":false,"schema":{"type":"string"}},{"name":"header:linkedDocumentNumber","in":"query","description":"Used only for return transactions and refers to the original ‘sell’ document.","required":false,"schema":{"type":"string"}},{"name":"header:purchasePlace","in":"query","required":false,"schema":{"type":"string"}},{"name":"channelId","in":"query","required":false,"schema":{"type":"string"}},{"name":"header:purchasedAt","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"grossValue","in":"query","required":false,"schema":{"type":"number"}},{"name":"matched","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"header:labels","in":"query","description":"Labels using pattern e.g. (key1;value1),(key2;value2),...","required":false,"schema":{"type":"string"}},{"name":"items:labels","in":"query","description":"Labels using pattern e.g. (key1;value1),(key2;value2),...","required":false,"schema":{"type":"string"}},{"name":"items:category","in":"query","required":false,"schema":{"type":"string"}},{"name":"items:sku","in":"query","required":false,"schema":{"type":"string"}},{"name":"items:maker","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/itemsOnPage"},{"$ref":"#/components/parameters/orderBy"},{"$ref":"#/components/parameters/scroll"}],"responses":{"200":{"description":"List of transactions","content":{"application/json":{"schema":{"oneOf":[{"title":"TransactionsResponse","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}},"total":{"$ref":"#/components/schemas/SearchableTotalResponse"}},"type":"object"},{"title":"TransactionsResponseWithScroll","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}},"scroll":{"description":"Scroll identifier for pagination","type":"string"}},"type":"object"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/AccessDenied"}}}}}}
````

## Add a transaction

> \<label style="background-color: #BFE1F6;padding:5px;">Integration\</label>\<br>\<br>\
> This method allows creating a new Transaction.<br>

````json
{"openapi":"3.0.0","info":{"title":"Open Loyalty","version":"0.0.1"},"tags":[{"name":"Transactions","description":"These endpoints will allow you to easily manage transactions."}],"servers":[{"url":"http://openloyalty.localhost"}],"security":[{"Bearer":[]},{"token":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","description":"Open Loyalty has the JWT authorization.\nTo learn what a JSON Web Token is and how it works, check out Introduction to JSON Web Tokens <https://jwt.io/introduction/>\n\n### Obtain an access token\n\nSend a request with the parameters username and password\n\n#### Definition\n\n`POST /api/admin/login_check` [Go to definition](#operation/adminLoginCheck)\\\n`POST /api/{storeCode}/member/login_check` [Go to definition](#operation/memberLoginCheck)\n\n#### Example\n\n```bash\ncurl {HOST}/api/admin/login_check\n    -H 'Content-Type: application/json;charset=UTF-8'\n    -H 'Accept: application/json, text/plain, */*'\n    --data-binary '{\"username\":\"admin\",\"password\":\"password\"}'\n```\n\n#### Example Response\n\n```json\n{\n    \"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6...\",\n    \"refresh_token\":\"0558f8bb29948c4e54c443f...\"\n}\n```\n\n### Using JSON Web Token\n\nAdd authorization header to each request\\\n`Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...`\\\nYou can now access any API method you want under the /api prefix.\n\n#### Example\n```bash\ncurl {HOST}/api/{storeCode}/analytics/members\n    -H 'Accept: application/json'\n    -H 'Content-type: application/x-www-form-urlencoded'\n    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...'\n```\n\n### Refresh JSON Web Token\nYou can refresh token using refresh_token that was given during login.\\\nThere are two endpoints\\\nTo refresh admin token `POST /api/token/refresh` [Go to definition](#operation/tokenRefresh)\\\nTo refresh member token `POST /api/{storeCode}/token/refresh` [Go to definition](#operation/tokenRefreshMember)\n","name":"Authorization","in":"header","bearerFormat":"JWT","scheme":"bearer"},"token":{"type":"apiKey","name":"X-AUTH-TOKEN","in":"header"}},"parameters":{"storeCode":{"name":"storeCode","in":"path","description":"Store code","required":true,"schema":{"type":"string"}}},"schemas":{"PostTransaction":{"properties":{"transaction":{"required":["header","items"],"properties":{"customerData":{"properties":{"customerId":{"type":"string"},"address":{"$ref":"#/components/schemas/CustomerAddressFormType"},"email":{"type":"string"},"loyaltyCardNumber":{"type":"string"},"name":{"type":"string"},"nip":{"type":"string"},"phone":{"type":"string"}},"type":"object","additionalProperties":false},"items":{"type":"array","items":{"required":["sku","name","grossValue","category"],"properties":{"category":{"type":"string"},"grossValue":{"type":"number","format":"float"},"maker":{"type":"string"},"name":{"type":"string"},"quantity":{"description":"The quantity of the product. This field is required if 'highPrecisionQuantity' is not provided. It is recommended to use 'highPrecisionQuantity', as 'quantity' is deprecated.","type":"integer","deprecated":true},"highPrecisionQuantity":{"description":"The precise quantity of the product, with a maximum of 3 decimal places. This field is required if 'quantity' is not provided.","type":"number","format":"float"},"sku":{"type":"string"},"labels":{"type":"array","items":{"$ref":"#/components/schemas/TransactionLabelFormType"}}},"type":"object","additionalProperties":false}},"channelId":{"type":"string","format":"uuid"},"header":{"required":["documentNumber","purchasedAt"],"properties":{"documentNumber":{"description":"Specifies the document number used in the transaction.","type":"string"},"linkedDocumentNumber":{"description":"Used only for return transactions and refers to the original ‘sell’ document.","type":"string"},"documentType":{"type":"string","enum":["sell","return"]},"labels":{"type":"array","items":{"$ref":"#/components/schemas/TransactionLabelFormType"}},"purchasedAt":{"type":"string"},"purchasePlace":{"type":"string"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false},"CustomerAddressFormType":{"properties":{"street":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"postal":{"type":"string"},"city":{"type":"string"},"province":{"type":"string"},"country":{"description":"The country code in ISO 3166-1 alpha-2 format. This should be a two-letter uppercase string representing a valid country code. Examples:  - `US` (United States) - `PL` (Poland)","type":"string"}},"type":"object"},"TransactionLabelFormType":{"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"ExpiredToken":{"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"type":"object"},"InvalidToken":{"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"type":"object"},"Unauthorized":{"required":["message"],"properties":{"message":{"type":"string"}},"type":"object"}},"responses":{"BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"required":["code","message","errors"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"errors":{"type":"array","items":{"required":["message","parameters","plural","code","path"],"properties":{"message":{"type":"string"},"parameters":{},"plural":{"type":"integer","nullable":true},"code":{"type":"string"},"path":{"type":"string"}},"type":"object"}}},"type":"object"}}}},"AccessDenied":{"description":"Forbidden.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}}}},"paths":{"/api/{storeCode}/transaction":{"post":{"tags":["Transactions"],"summary":"Add a transaction","description":"<label style=\"background-color: #BFE1F6;padding:5px;\">Integration</label><br><br>\nThis method allows creating a new Transaction.\n","operationId":"_transactionPost","parameters":[{"$ref":"#/components/parameters/storeCode"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostTransaction"}}}},"responses":{"200":{"description":"Return registered transaction id.","content":{"application/json":{"schema":{"properties":{"transactionId":{"description":"Registered transaction identity","type":"string","format":"uuid"}},"type":"object"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ExpiredToken"},{"$ref":"#/components/schemas/InvalidToken"},{"$ref":"#/components/schemas/Unauthorized"}]}}}},"403":{"$ref":"#/components/responses/AccessDenied"}}}}}}
````

## Update transaction’s custom attribute

> \<label style="background-color: #BFE1F6;padding:5px;">Integration\</label>\<br>\<br>\
> This method allows editing of Transaction labels.<br>

````json
{"openapi":"3.0.0","info":{"title":"Open Loyalty","version":"0.0.1"},"tags":[{"name":"Transactions","description":"These endpoints will allow you to easily manage transactions."}],"servers":[{"url":"http://openloyalty.localhost"}],"security":[{"Bearer":[]},{"token":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","description":"Open Loyalty has the JWT authorization.\nTo learn what a JSON Web Token is and how it works, check out Introduction to JSON Web Tokens <https://jwt.io/introduction/>\n\n### Obtain an access token\n\nSend a request with the parameters username and password\n\n#### Definition\n\n`POST /api/admin/login_check` [Go to definition](#operation/adminLoginCheck)\\\n`POST /api/{storeCode}/member/login_check` [Go to definition](#operation/memberLoginCheck)\n\n#### Example\n\n```bash\ncurl {HOST}/api/admin/login_check\n    -H 'Content-Type: application/json;charset=UTF-8'\n    -H 'Accept: application/json, text/plain, */*'\n    --data-binary '{\"username\":\"admin\",\"password\":\"password\"}'\n```\n\n#### Example Response\n\n```json\n{\n    \"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6...\",\n    \"refresh_token\":\"0558f8bb29948c4e54c443f...\"\n}\n```\n\n### Using JSON Web Token\n\nAdd authorization header to each request\\\n`Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...`\\\nYou can now access any API method you want under the /api prefix.\n\n#### Example\n```bash\ncurl {HOST}/api/{storeCode}/analytics/members\n    -H 'Accept: application/json'\n    -H 'Content-type: application/x-www-form-urlencoded'\n    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...'\n```\n\n### Refresh JSON Web Token\nYou can refresh token using refresh_token that was given during login.\\\nThere are two endpoints\\\nTo refresh admin token `POST /api/token/refresh` [Go to definition](#operation/tokenRefresh)\\\nTo refresh member token `POST /api/{storeCode}/token/refresh` [Go to definition](#operation/tokenRefreshMember)\n","name":"Authorization","in":"header","bearerFormat":"JWT","scheme":"bearer"},"token":{"type":"apiKey","name":"X-AUTH-TOKEN","in":"header"}},"parameters":{"storeCode":{"name":"storeCode","in":"path","description":"Store code","required":true,"schema":{"type":"string"}},"transaction":{"name":"transaction","in":"path","description":"Transaction ID","required":true,"schema":{"type":"string","format":"uuid"}}},"schemas":{"AddLabelsFormType":{"required":["labels"],"properties":{"labels":{"type":"array","items":{"$ref":"#/components/schemas/UserLabelFormType"}}},"type":"object"},"UserLabelFormType":{"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"}},"responses":{"NoContent":{"description":"Success. No content."},"BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"required":["code","message","errors"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"errors":{"type":"array","items":{"required":["message","parameters","plural","code","path"],"properties":{"message":{"type":"string"},"parameters":{},"plural":{"type":"integer","nullable":true},"code":{"type":"string"},"path":{"type":"string"}},"type":"object"}}},"type":"object"}}}},"AccessDenied":{"description":"Forbidden.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}},"NotFound":{"description":"Not found.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}}}},"paths":{"/api/{storeCode}/transaction/{transaction}/labels":{"put":{"tags":["Transactions"],"summary":"Update transaction’s custom attribute","description":"<label style=\"background-color: #BFE1F6;padding:5px;\">Integration</label><br><br>\nThis method allows editing of Transaction labels.\n","operationId":"labelPut","parameters":[{"$ref":"#/components/parameters/storeCode"},{"$ref":"#/components/parameters/transaction"}],"requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddLabelsFormType"}}}},"responses":{"204":{"$ref":"#/components/responses/NoContent"},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/AccessDenied"},"404":{"$ref":"#/components/responses/NotFound"}}}}}}
````

## Delete transaction’s custom attribute

> \<label style="background-color: #BFE1F6;padding:5px;">Integration\</label>\<br>\<br>\
> This method allows removing a Transaction labels.<br>

````json
{"openapi":"3.0.0","info":{"title":"Open Loyalty","version":"0.0.1"},"tags":[{"name":"Transactions","description":"These endpoints will allow you to easily manage transactions."}],"servers":[{"url":"http://openloyalty.localhost"}],"security":[{"Bearer":[]},{"token":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","description":"Open Loyalty has the JWT authorization.\nTo learn what a JSON Web Token is and how it works, check out Introduction to JSON Web Tokens <https://jwt.io/introduction/>\n\n### Obtain an access token\n\nSend a request with the parameters username and password\n\n#### Definition\n\n`POST /api/admin/login_check` [Go to definition](#operation/adminLoginCheck)\\\n`POST /api/{storeCode}/member/login_check` [Go to definition](#operation/memberLoginCheck)\n\n#### Example\n\n```bash\ncurl {HOST}/api/admin/login_check\n    -H 'Content-Type: application/json;charset=UTF-8'\n    -H 'Accept: application/json, text/plain, */*'\n    --data-binary '{\"username\":\"admin\",\"password\":\"password\"}'\n```\n\n#### Example Response\n\n```json\n{\n    \"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6...\",\n    \"refresh_token\":\"0558f8bb29948c4e54c443f...\"\n}\n```\n\n### Using JSON Web Token\n\nAdd authorization header to each request\\\n`Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...`\\\nYou can now access any API method you want under the /api prefix.\n\n#### Example\n```bash\ncurl {HOST}/api/{storeCode}/analytics/members\n    -H 'Accept: application/json'\n    -H 'Content-type: application/x-www-form-urlencoded'\n    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...'\n```\n\n### Refresh JSON Web Token\nYou can refresh token using refresh_token that was given during login.\\\nThere are two endpoints\\\nTo refresh admin token `POST /api/token/refresh` [Go to definition](#operation/tokenRefresh)\\\nTo refresh member token `POST /api/{storeCode}/token/refresh` [Go to definition](#operation/tokenRefreshMember)\n","name":"Authorization","in":"header","bearerFormat":"JWT","scheme":"bearer"},"token":{"type":"apiKey","name":"X-AUTH-TOKEN","in":"header"}},"parameters":{"storeCode":{"name":"storeCode","in":"path","description":"Store code","required":true,"schema":{"type":"string"}},"transaction":{"name":"transaction","in":"path","description":"Transaction ID","required":true,"schema":{"type":"string","format":"uuid"}}},"schemas":{"RemoveLabelsFormType":{"required":["labels"],"properties":{"labels":{"type":"array","items":{"$ref":"#/components/schemas/UserLabelFormType"}}},"type":"object"},"UserLabelFormType":{"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"}},"responses":{"NoContent":{"description":"Success. No content."},"BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"required":["code","message","errors"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"errors":{"type":"array","items":{"required":["message","parameters","plural","code","path"],"properties":{"message":{"type":"string"},"parameters":{},"plural":{"type":"integer","nullable":true},"code":{"type":"string"},"path":{"type":"string"}},"type":"object"}}},"type":"object"}}}},"AccessDenied":{"description":"Forbidden.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}},"NotFound":{"description":"Not found.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}}}},"paths":{"/api/{storeCode}/transaction/{transaction}/labels":{"delete":{"tags":["Transactions"],"summary":"Delete transaction’s custom attribute","description":"<label style=\"background-color: #BFE1F6;padding:5px;\">Integration</label><br><br>\nThis method allows removing a Transaction labels.\n","operationId":"lebelDelete","parameters":[{"$ref":"#/components/parameters/storeCode"},{"$ref":"#/components/parameters/transaction"}],"requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveLabelsFormType"}}}},"responses":{"204":{"$ref":"#/components/responses/NoContent"},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/AccessDenied"},"404":{"$ref":"#/components/responses/NotFound"}}}}}}
````

## Match the transaction

> \<label style="background-color: #D4EDBC;padding:5px;">Management\</label>\<br>\<br>\
> This method allows importing assignments to Transaction.<br>

````json
{"openapi":"3.0.0","info":{"title":"Open Loyalty","version":"0.0.1"},"tags":[{"name":"Transactions","description":"These endpoints will allow you to easily manage transactions."}],"servers":[{"url":"http://openloyalty.localhost"}],"security":[{"Bearer":[]},{"token":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","description":"Open Loyalty has the JWT authorization.\nTo learn what a JSON Web Token is and how it works, check out Introduction to JSON Web Tokens <https://jwt.io/introduction/>\n\n### Obtain an access token\n\nSend a request with the parameters username and password\n\n#### Definition\n\n`POST /api/admin/login_check` [Go to definition](#operation/adminLoginCheck)\\\n`POST /api/{storeCode}/member/login_check` [Go to definition](#operation/memberLoginCheck)\n\n#### Example\n\n```bash\ncurl {HOST}/api/admin/login_check\n    -H 'Content-Type: application/json;charset=UTF-8'\n    -H 'Accept: application/json, text/plain, */*'\n    --data-binary '{\"username\":\"admin\",\"password\":\"password\"}'\n```\n\n#### Example Response\n\n```json\n{\n    \"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6...\",\n    \"refresh_token\":\"0558f8bb29948c4e54c443f...\"\n}\n```\n\n### Using JSON Web Token\n\nAdd authorization header to each request\\\n`Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...`\\\nYou can now access any API method you want under the /api prefix.\n\n#### Example\n```bash\ncurl {HOST}/api/{storeCode}/analytics/members\n    -H 'Accept: application/json'\n    -H 'Content-type: application/x-www-form-urlencoded'\n    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...'\n```\n\n### Refresh JSON Web Token\nYou can refresh token using refresh_token that was given during login.\\\nThere are two endpoints\\\nTo refresh admin token `POST /api/token/refresh` [Go to definition](#operation/tokenRefresh)\\\nTo refresh member token `POST /api/{storeCode}/token/refresh` [Go to definition](#operation/tokenRefreshMember)\n","name":"Authorization","in":"header","bearerFormat":"JWT","scheme":"bearer"},"token":{"type":"apiKey","name":"X-AUTH-TOKEN","in":"header"}},"parameters":{"storeCode":{"name":"storeCode","in":"path","description":"Store code","required":true,"schema":{"type":"string"}}},"schemas":{"ManuallyAssignCustomerToTransactionFormType":{"required":["transactionDocumentNumber"],"properties":{"transactionDocumentNumber":{"type":"string"},"customerId":{"type":"string"},"customerLoyaltyCardNumber":{"type":"string"},"customerPhoneNumber":{"type":"string"}},"type":"object"}},"responses":{"BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"required":["code","message","errors"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"errors":{"type":"array","items":{"required":["message","parameters","plural","code","path"],"properties":{"message":{"type":"string"},"parameters":{},"plural":{"type":"integer","nullable":true},"code":{"type":"string"},"path":{"type":"string"}},"type":"object"}}},"type":"object"}}}},"AccessDenied":{"description":"Forbidden.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}}}},"paths":{"/api/{storeCode}/transaction/assign":{"post":{"tags":["Transactions"],"summary":"Match the transaction","description":"<label style=\"background-color: #D4EDBC;padding:5px;\">Management</label><br><br>\nThis method allows importing assignments to Transaction.\n","operationId":"transactionPostMemberAssign","parameters":[{"$ref":"#/components/parameters/storeCode"}],"requestBody":{"description":"","content":{"application/json":{"schema":{"properties":{"assign":{"$ref":"#/components/schemas/ManuallyAssignCustomerToTransactionFormType"}},"type":"object"}}}},"responses":{"200":{"description":"Return transaction ID and assigned member ID.","content":{"application/json":{"schema":{"properties":{"transactionId":{"type":"string"},"customerId":{"type":"string"}},"type":"object"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/AccessDenied"}}}}}}
````


---

# 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://help.openloyalty.io/api-reference/transactions.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.
