{"openapi":"3.0.1","info":{"title":"Facilipay API v2","description":"Official Facilipay public API for third-party integrators. Covers authentication and registration, member accounts, merchant details, transactions and customers, inventory (products, categories, modifier groups), orders, campaigns, gift card liability reporting, payments, and digital gift card delivery. Each operation lists its supported authentication schemes: an API key issued from the Facilipay Dashboard (X-API-Key header) where ApiKeyAuth is shown, or a merchant JWT bearer token. For access and support, contact support@facilipay.io.\n\n## Redeem gift cards at a point of sale\n\nA POS takes payment from a Facilipay gift card with two calls: look the card up, then debit it. A customer's gift card value, prepaid top-ups and cashless credit at a merchant sit in one stored-value balance, so the same calls spend all three.\n\n`POST /payments` is deprecated and will be replaced by an order-based endpoint. It remains the way to redeem stored value until then. Requests that pass validation get `Deprecation` and `Sunset` headers on the response.\n\n### 1. Create an API key\n\nIn the Facilipay Dashboard, sign in as the merchant whose cards the POS will accept and create an API key with the `customers:read`, `payments:write` and `transactions:read` scopes. Send it in the `X-API-Key` header on every call.\n\nThe merchant that is debited is worked out from the user who created the key: the first merchant that user owns, or failing that the first one they work at. It is not the merchant in the request. If that user owns more than one merchant, create the key from a user linked to this merchant only, or the lookup and the debit can land on another merchant.\n\n### 2. Look up the card\n\n`GET /merchants/{merchantId}/customers/account/{accountId}`, where `accountId` is the card number: the account number printed on the card, also encoded in the QR code of the customer's wallet pass.\n\n- `balance.cash_balance` is the spendable balance in major units, returned as a decimal string: `\"25.50\"` means €25.50. Parse it before comparing or adding. For a franchise it is the balance across the franchise.\n- An unknown card returns `400` with the message `Account doesnt exist`.\n- A card that exists but has no registered customer returns `200` with `cardStatus: 0` and **no** `balance` object. Treat it as unusable.\n- Check `error` as well as the status: a key whose user has no merchant gets `200` with `\"error\": true` and `Merchant not found`.\n\n### 3. Redeem\n\n`POST /payments` as `application/x-www-form-urlencoded`:\n\n| Field | Value |\n| --- | --- |\n| `payment_type` | `gift` |\n| `customer_id` | the card number from step 2 |\n| `amount` | the amount to take, in **minor units and negative**: `-2550` takes €25.50 |\n| `identifier` | a reference unique to this sale, e.g. your receipt number; used to check a payment after a timeout |\n| `terminal_id` | optional, your till or terminal id, stored on the transaction |\n\nA positive `amount` loads value onto the card instead of taking it, so always send redemptions as negative numbers.\n\n- **Success** is `200` with `{\"error\": false, \"message\": \"Transaction Processed\"}`. The response does not include the new balance; look the card up again if the receipt needs it.\n- **Balance too low.** Normally the debit is rejected in full with `401` and the message `INSUFFICIENT BALANCE`, and nothing is taken. Two merchant settings change that: a customer with a credit allowance can go below zero, and a merchant set up to charge shortfalls to the customer's saved bank card takes the difference from that card. In both cases the call succeeds.\n- **Split tender.** Never send more than the balance you looked up in step 2. Redeem the smaller of the balance and the bill and take the rest by another payment method; otherwise the customer can be charged twice for the difference. The balance is not locked between the lookup and the debit.\n- **No retries on timeout.** The call is not idempotent: sending it again debits the card again. If a request times out or returns `500` or `502`, wait at least a minute, because the payment can still complete after your request has failed. Then check it with `GET /merchants/{merchantId}/transactions/byUniqueId/{identifier}` (`transactions:read` scope). `200` with a `transaction` whose `unique_identifier` equals your `identifier` means it was applied. `404` means it was not, and you can send it again. Use identifiers that are not the start of another one, such as fixed-length receipt numbers, so a match is always yours.\n- Do not send an `X-API-Version` header on this call. It switches the endpoint to a different response format.\n\n### Errors on `POST /payments`\n\n| Status | Meaning |\n| --- | --- |\n| `400` | Validation failed, unknown card (`Account doesnt exist`), expired card, or the API key's user is not an employee of the merchant (`Invalid parameters`) |\n| `401` | Invalid or expired API key, **or** insufficient balance (`INSUFFICIENT BALANCE`), **or** the card is blocked or expired. Check the `message` before treating it as an authentication failure |\n| `403` | The API key lacks the `payments:write` scope, or the customer is blocked at this merchant |\n| `422` | The API key is not linked to a merchant |\n| `500` / `502` | The payment could not be confirmed. It may or may not have been applied: wait a minute and check with `byUniqueId` before retrying |\n","termsOfService":"https://facilipay.io/terms/","version":"2.0.0"},"servers":[{"url":"https://api-staging.loylap.com/v2","description":"Staging server"},{"url":"https://api.loylap.com/v2","description":"Production server"}],"tags":[{"name":"auth","x-displayName":"Authentication","description":"Login, token refresh, password recovery and registration"},{"name":"member","x-displayName":"Members","description":"Access to Member data"},{"name":"merchant","x-displayName":"Merchant Details","description":"Access to Merchant data"},{"name":"merchant-customers","x-displayName":"Customers","description":"A merchant's customers, their cards and account activation"},{"name":"merchant-transactions","x-displayName":"Transactions","description":"A merchant's transaction history"},{"name":"merchant-orders","x-displayName":"Orders","description":"A merchant's orders and ordered products"},{"name":"merchant-reporting","x-displayName":"Reporting","description":"Gift card liability and reconciliation reports"},{"name":"inventory-products","x-displayName":"Products","description":"Inventory products of the authenticated merchant"},{"name":"inventory-categories","x-displayName":"Categories","description":"Inventory categories of the authenticated merchant"},{"name":"inventory-modifier-groups","x-displayName":"Modifier Groups","description":"Inventory modifier groups of the authenticated merchant"},{"name":"merchant-inventory-products","x-displayName":"Products (by merchant ID)","description":"Inventory products of a given merchant"},{"name":"merchant-inventory-categories","x-displayName":"Categories (by merchant ID)","description":"Inventory categories of a given merchant"},{"name":"merchant-inventory-modifier-groups","x-displayName":"Modifier Groups (by merchant ID)","description":"Inventory modifier groups of a given merchant"},{"name":"campaigns","x-displayName":"Campaigns","description":"Campaign listing, details, stats and status"},{"name":"campaign-rules","x-displayName":"Segmentation Rules","description":"Rules that decide which customers a campaign targets"},{"name":"campaign-rewards","x-displayName":"Rewards","description":"What a campaign gives to matching customers"},{"name":"payment","x-displayName":"Payments","description":"Access to payment information"},{"name":"gift-cards","x-displayName":"Gift Cards","description":"Digital gift card delivery"},{"name":"reporting","x-displayName":"Gateway Reports","description":"Gateway transaction and batch reporting"}],"x-tagGroups":[{"name":"Accounts","tags":["auth","member"]},{"name":"Merchants","tags":["merchant","merchant-customers","merchant-transactions","merchant-orders","merchant-reporting","reporting"]},{"name":"Inventory","tags":["inventory-products","inventory-categories","inventory-modifier-groups","merchant-inventory-products","merchant-inventory-categories","merchant-inventory-modifier-groups"]},{"name":"Campaigns","tags":["campaigns","campaign-rules","campaign-rewards"]},{"name":"Payments","tags":["payment","gift-cards"]}],"paths":{"/auth/refresh":{"post":{"tags":["auth"],"summary":"Renews authentication token","operationId":"createNewJWT","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"required":["refresh_token"],"type":"object","properties":{"refresh_token":{"type":"string","example":"bb387a63-75b5-4a50-8026-ba14272b863f","description":"Refresh token issued at previous login"}}}}},"required":true},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthRefreshResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/auth/login/email":{"post":{"tags":["auth"],"summary":"Authenticates the user by email in the system","description":"Email and password login. Repeated failures on the account or the calling IP, or a login from a different country than the last successful one, make the API answer `406` until the request is repeated with a Google reCAPTCHA v2 token in `captcha_code`. Too many failures lock the account for a while (`423`) and notify its owner. Limited to 10 requests per minute per IP.","operationId":"createAuthByEmail","requestBody":{"description":"Credentials object to authenticate an user","content":{"application/json":{"schema":{"required":["email","password"],"type":"object","properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","format":"password"},"captcha_code":{"type":"string","description":"Google reCAPTCHA v2 token, required after a `406`"}}}}}},"parameters":[{"name":"RememberMe","in":"header","description":"Any value extends the token lifetime","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"User logged in successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid credentials","content":{}},"406":{"description":"Captcha required, or the supplied captcha was rejected","content":{}},"423":{"description":"Account temporarily locked after repeated failures","content":{}},"429":{"description":"Too many requests","content":{}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/auth/forgot/init/email":{"post":{"tags":["auth"],"summary":"Starts recovering a forgotten password by email","operationId":"createPasswordRecoveryByEmail","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"required":["email"],"type":"object","properties":{"email":{"type":"string","description":"Email of user"}}}}},"required":true},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"success"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Email not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/auth/resend-activation":{"post":{"tags":["auth"],"summary":"Re-send the account activation email","description":"Re-sends the activation link to a pending account created through `POST /member` or `POST /merchants`. Reuses the code the account already holds, so earlier links stay valid. Always answers `200` for a well-formed request, whether or not an email was sent, so the endpoint cannot be used to probe which addresses are registered. Limited to 30 requests per minute per IP.","operationId":"resendActivation","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email","example":"jane.doe@example.com"},"merchant_id":{"type":"integer","format":"int64","description":"Brand the email for this merchant and scope the activation link to it","example":253},"source":{"type":"string","enum":["events"],"description":"Originating app; the activation link redirects back into it"}}}}}},"responses":{"200":{"description":"Request accepted","content":{}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests","content":{}}}}},"/member":{"post":{"tags":["member"],"summary":"Register a new member","description":"Creates a member account and emails an activation link. The account stays PENDING until the link is used, so `tokens` are only returned when the account can log in straight away. Send `temporary: true` for a guest account: it is created ACTIVE, no email is sent and `tokens` are returned immediately. `merchant_id` also enrols the member in that merchant's loyalty programme.","operationId":"registerMember","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email","example":"jane.doe@example.com"},"password":{"type":"string","format":"password","minLength":8,"description":"Omit to let the member set a password from the activation link"},"name":{"type":"string","example":"Jane Doe"},"phone_number":{"type":"string","example":"+353871234567"},"merchant_id":{"type":"string","description":"Enrol the member with this merchant and brand the activation email","example":"253"},"card_number":{"type":"string","description":"Existing physical card to link to the new account"},"receive_updates":{"type":"boolean"},"temporary":{"type":"boolean","description":"Guest account. Created ACTIVE, no activation email, tokens returned"},"onboarding_type":{"type":"integer","enum":[1,2],"description":"USER: 1 (default), MERCHANT: 2 (owner account for a merchant sign-up)"},"onboarding_source":{"type":"string","enum":["events"],"description":"Originating app; the activation link redirects back into it"}}}}}},"responses":{"200":{"description":"Account created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterMemberResponse"}}}},"400":{"description":"Bad request, or the email is already registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/member/account/{accountId}":{"get":{"tags":["member"],"summary":"Get the user information from the account ID","operationId":"getMemberAccount","parameters":[{"name":"accountId","in":"path","description":"Member account ID","required":true,"schema":{"type":"integer","format":"int32","example":22014505}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/merchants":{"post":{"tags":["merchant"],"summary":"Register a new merchant","description":"Creates a merchant (group, default branch, owner employee, default settings) for the authenticated user, who must already exist, typically created moments earlier with `POST /member` using `onboarding_type: 2`. The body shape depends on `platform_name`. Documented here is the self-serve flow (`web`, `ios`, `android`); the POS flows (`clover`, the PAX terminal platforms, `poynt`) carry platform credentials instead and are driven by the POS apps.","operationId":"registerMerchant","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["platform_name","business_name","email"],"properties":{"platform_name":{"type":"string","enum":["web","ios","android"],"example":"web"},"business_name":{"type":"string","example":"Nobodys Store"},"email":{"type":"string","format":"email","description":"Email of the owner account (must match the authenticated user)","example":"store@nobodys.com"},"address":{"type":"string","example":"1 Main Street, Dublin 2, Ireland"},"phone":{"type":"string"},"website":{"type":"string","format":"uri"},"products":{"type":"array","description":"Facilipay products to enable","items":{"type":"string"}},"category":{"type":"string","description":"Business category name"},"business_category_id":{"type":"integer","format":"int64"},"business_subcategory_id":{"type":"integer","format":"int64"}}}}}},"responses":{"200":{"description":"Merchant created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterMerchantResponse"}}}},"400":{"description":"Bad request, unknown platform_name, or the owner already has a merchant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/merchants/{merchantId}":{"get":{"tags":["merchant"],"summary":"Returns merchant details","operationId":"getMerchantById","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantResponse"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/merchants/{merchantId}/transactions/byUniqueId/{uniqueIdentifier}":{"get":{"tags":["merchant-transactions"],"summary":"Find a transaction by your identifier","description":"Returns the merchant's stored-value transaction whose identifier is `uniqueIdentifier`, usually the `identifier` sent to `POST /payments`; if none matches exactly, one whose identifier starts with it. Compare the returned `unique_identifier` with yours. Reads the primary database, so a payment that has completed is always found. Use it after a timeout, `500` or `502` to check whether a redemption was applied before retrying. Accepts an API key with the `transactions:read` scope.","operationId":"getTransactionByUniqueId","parameters":[{"name":"merchantId","in":"path","description":"Numeric ID of the merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"uniqueIdentifier","in":"path","description":"The `identifier` sent with the payment, or its beginning","required":true,"schema":{"type":"string","example":"POS-1042-000731"}}],"responses":{"200":{"description":"A matching transaction exists, so the payment was applied.","content":{"application/json":{"schema":{"type":"object","properties":{"transaction":{"type":"object","description":"The stored-value ledger row (amount, type, dates).","properties":{"unique_identifier":{"type":"string","description":"The identifier stored with the payment. Check it equals yours."}}}}}}}},"404":{"description":"No transaction with this identifier, so the payment was not applied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"boolean","example":true},"message":{"type":"string","example":"Transaction not found with the provided unique identifier"}}}}}}},"security":[{"authorization":[]},{"ApiKeyAuth":[]}]}},"/merchants/{merchantId}/transactions/v2":{"get":{"tags":["merchant-transactions"],"summary":"List merchant transaction","description":"Filters list of merchant's transaction use for Pagination","operationId":"getAllTransactions","parameters":[{"name":"merchantId","in":"path","description":"Numeric ID of merchant to get all transaction","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"exports_to","in":"query","description":"The flag used to export the list as CSV","schema":{"type":"string","default":"csv"}},{"name":"offset","in":"query","description":"The number of merchant transaction to skip before starting to collect the list of merchant transaction","schema":{"type":"integer","minimum":0,"default":0,"example":10}},{"name":"limit","in":"query","description":"The numbers of transaction to return in a list of merchant transaction","schema":{"type":"integer","minimum":1,"default":10,"example":20}},{"name":"order","in":"query","description":"The sorting key to return the list of merchant transaction","schema":{"type":"string","default":"id","example":"desc"}},{"name":"view_all","in":"query","style":"form","explode":true,"description":"Get list of all customers","required":false,"schema":{"type":"string","default":true,"example":true}},{"name":"qfields","in":"query","description":"Select the fields to return in the list","style":"deepObject","explode":true,"schema":{"type":"object","enum":["name","date_add","amount","payment_type","transaction_type","account_id","merchant_id","branch_id","employee_id","customer_id"],"example":[{"0":"name"},{"1":"date_add"},{"2":"amount"},{"3":"payment_type"},{"4":"transaction_type"},{"5":"account_id"},{"6":"merchant_id"},{"7":"branch_id"},{"8":"employee_id"},{"9":"customer_id"}]}},{"name":"gq","in":"query","description":"Global Search for advanced filter, read more about in https://github.com/conorot/api-service/wiki/Global-Search","style":"deepObject","explode":true,"schema":{"type":"object","anyOf":[{"type":"object","properties":{"NextArrayIndex":{"type":"object","properties":{"AnyFieldName":{"type":"object","properties":{"eq":{"type":"array","description":"The EQ (Equals) operator only works with fields of types Boolean, Date, and Number","items":{"oneOf":[{"type":"boolean","example":true},{"type":"string","format":"date"},{"type":"string","format":"date-time"},{"type":"number","example":49.99},{"type":"integer","example":125}]}}}}}}}},{"type":"object","properties":{"NextArrayIndex":{"type":"object","properties":{"AnyFieldName":{"type":"object","oneOf":[{"properties":{"ct":{"type":"array","description":"The CT (Contains) operator only works with fields of type text","items":{"oneOf":[{"type":"string","example":"Nobody"}]}}}},{"properties":{"nct":{"type":"array","description":"The NCT (Not Contains) operator only works with fields of type text","items":{"oneOf":[{"type":"string","example":"Skywalker"}]}}}},{"properties":{"sw":{"type":"array","description":"The SW (Starts with) operator only works with fields of type text","items":{"oneOf":[{"type":"string","example":"John"}]}}}},{"properties":{"nsw":{"type":"array","description":"The NSW (Not Starts with) operator only works with fields of type text","items":{"oneOf":[{"type":"string","example":"Obi-Wan"}]}}}},{"properties":{"ew":{"type":"array","description":"The EW (Ends with) operator only works with fields of type text","items":{"oneOf":[{"type":"string","example":"Kenobi"}]}}}},{"properties":{"new":{"type":"array","description":"The NEW (Not Ends with) operator only works with fields of type text","items":{"oneOf":[{"type":"string","example":"Vader"}]}}}}]}}}}},{"type":"object","properties":{"NextArrayIndex":{"type":"object","properties":{"AnyFieldName":{"type":"object","oneOf":[{"properties":{"eq":{"type":"array","description":"The EQ (Equals) operator only works with fields of types Boolean, Date, and Number","items":{"oneOf":[{"type":"string","format":"date"},{"type":"string","format":"date-time"}]}}}},{"properties":{"gt":{"type":"array","description":"The GT (Greater than) operator only works with fields of types Date and Number","items":{"oneOf":[{"type":"string","format":"date"},{"type":"string","format":"date-time"}]}}}},{"properties":{"st":{"type":"array","description":"The ST (Smaller than) operator only works with fields of types Date and Number","items":{"oneOf":[{"type":"string","format":"date"},{"type":"string","format":"date-time"}]}}}},{"properties":{"bt":{"type":"array","description":"The BT (Between) operator only works with fields of types Date and Number","items":{"oneOf":[{"type":"string","format":"date"},{"type":"string","format":"date-time"}]},"example":["2023-02-17T00:00:00.000Z","2023-02-17T23:59:59.999Z"]}}}]}}}}},{"type":"object","properties":{"NextArrayIndex":{"type":"object","properties":{"AnyFieldName":{"type":"object","oneOf":[{"properties":{"eq":{"type":"array","description":"The EQ (Equals) operator only works with fields of types Boolean, Date, and Number","items":{"oneOf":[{"type":"integer","example":125},{"type":"number","example":49.99}]}}}},{"properties":{"gt":{"type":"array","description":"The GT (Greater than) operator only works with fields of types Date and Number","items":{"oneOf":[{"type":"integer","example":10},{"type":"number","example":35.25}]}}}},{"properties":{"st":{"type":"array","description":"The ST (Smaller than) operator only works with fields of types Date and Number","items":{"oneOf":[{"type":"integer","example":99},{"type":"number","example":80.1}]}}}},{"properties":{"bt":{"type":"array","description":"The BT (Between) operator only works with fields of types Date and Number","items":{"oneOf":[{"type":"integer","example":[5,30]},{"type":"number","example":[15.99,100.3]}]}}}}]}}}}}]},"example":[{"0":{"amount":{"gt":[49.4]}}},{"1":{"name":{"ct":["Nobody"]}}},{"2":{"transaction_type":{"eq":"Add"}}}]}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTransactionsResponse"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]},{"ApiKeyAuth":[]}]}},"/merchants/{merchantId}/customers/v2":{"get":{"tags":["merchant-customers"],"summary":"list customers","description":"Filters list of merchant's customers use for Pagination","operationId":"getAllCustomers","parameters":[{"name":"merchantId","in":"path","description":"Numeric ID of the merchant to get all customers","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"exports_to","in":"query","description":"The flag used to export the list as CSV","schema":{"type":"string","default":"csv"}},{"name":"offset","in":"query","description":"The number of customers to skip before starting to collect the list of customers","schema":{"type":"integer","minimum":0,"default":0,"example":10}},{"name":"limit","in":"query","description":"The numbers of customers to return in a list of customers","schema":{"type":"integer","minimum":1,"default":10,"example":20}},{"name":"order","in":"query","description":"The sorting key to return the list of customers","schema":{"type":"string","default":"id","example":"balance"}},{"name":"direction","in":"query","description":"The sorting direction to return the list of customers","schema":{"type":"string","enum":["asc","desc"],"default":"asc","example":"desc"}},{"name":"q","in":"query","description":"The filtering text to return the list of customers","schema":{"type":"string","example":"nobody"}},{"name":"qfields","in":"query","description":"Select the fields to return in the list","style":"deepObject","explode":true,"schema":{"type":"object","enum":["name","email","nickname","card_number","balance","stamp","status"],"example":[{"0":"name"},{"1":"email"},{"2":"balance"},{"3":"status"}]}},{"name":"gq","in":"query","description":"Global Search for advanced filter, read more about in https://github.com/conorot/api-service/wiki/Global-Search","style":"deepObject","explode":true,"schema":{"type":"object","anyOf":[{"type":"object","properties":{"NextArrayIndex":{"type":"object","properties":{"AnyFieldName":{"type":"object","properties":{"eq":{"type":"array","description":"The EQ (Equals) operator only works with fields of types Boolean, Date, and Number","items":{"oneOf":[{"type":"boolean","example":true},{"type":"string","format":"date"},{"type":"string","format":"date-time"},{"type":"number","example":49.99},{"type":"integer","example":125}]}}}}}}}},{"type":"object","properties":{"NextArrayIndex":{"type":"object","properties":{"AnyFieldName":{"type":"object","oneOf":[{"properties":{"ct":{"type":"array","description":"The CT (Contains) operator only works with fields of type text","items":{"oneOf":[{"type":"string","example":"Nobody"}]}}}},{"properties":{"nct":{"type":"array","description":"The NCT (Not Contains) operator only works with fields of type text","items":{"oneOf":[{"type":"string","example":"Skywalker"}]}}}},{"properties":{"sw":{"type":"array","description":"The SW (Starts with) operator only works with fields of type text","items":{"oneOf":[{"type":"string","example":"John"}]}}}},{"properties":{"sw":{"type":"array","description":"The SW (Starts with) operator only works with fields of type text","items":{"oneOf":[{"type":"string","example":"John"}]}}}},{"properties":{"nsw":{"type":"array","description":"The NSW (Not Starts with) operator only works with fields of type text","items":{"oneOf":[{"type":"string","example":"Obi-Wan"}]}}}},{"properties":{"ew":{"type":"array","description":"The EW (Ends with) operator only works with fields of type text","items":{"oneOf":[{"type":"string","example":"Kenobi"}]}}}},{"properties":{"new":{"type":"array","description":"The NEW (Not Ends with) operator only works with fields of type text","items":{"oneOf":[{"type":"string","example":"Vader"}]}}}}]}}}}},{"type":"object","properties":{"NextArrayIndex":{"type":"object","properties":{"AnyFieldName":{"type":"object","oneOf":[{"properties":{"eq":{"type":"array","description":"The EQ (Equals) operator only works with fields of types Boolean, Date, and Number","items":{"oneOf":[{"type":"string","format":"date"},{"type":"string","format":"date-time"}]}}}},{"properties":{"gt":{"type":"array","description":"The GT (Greater than) operator only works with fields of types Date and Number","items":{"oneOf":[{"type":"string","format":"date"},{"type":"string","format":"date-time"}]}}}},{"properties":{"st":{"type":"array","description":"The ST (Smaller than) operator only works with fields of types Date and Number","items":{"oneOf":[{"type":"string","format":"date"},{"type":"string","format":"date-time"}]}}}},{"properties":{"bt":{"type":"array","description":"The BT (Between) operator only works with fields of types Date and Number","items":{"oneOf":[{"type":"string","format":"date"},{"type":"string","format":"date-time"}]},"example":["2023-02-17T00:00:00.000Z","2023-02-17T23:59:59.999Z"]}}}]}}}}},{"type":"object","properties":{"NextArrayIndex":{"type":"object","properties":{"AnyFieldName":{"type":"object","oneOf":[{"properties":{"eq":{"type":"array","description":"The EQ (Equals) operator only works with fields of types Boolean, Date, and Number","items":{"oneOf":[{"type":"integer","example":125},{"type":"number","example":49.99}]}}}},{"properties":{"gt":{"type":"array","description":"The GT (Greater than) operator only works with fields of types Date and Number","items":{"oneOf":[{"type":"integer","example":10},{"type":"number","example":35.25}]}}}},{"properties":{"st":{"type":"array","description":"The ST (Smaller than) operator only works with fields of types Date and Number","items":{"oneOf":[{"type":"integer","example":99},{"type":"number","example":80.1}]}}}},{"properties":{"bt":{"type":"array","description":"The BT (Between) operator only works with fields of types Date and Number","items":{"oneOf":[{"type":"integer","example":[5,30]},{"type":"number","example":[15.99,100.3]}]}}}}]}}}}}]},"example":[{"0":{"balance":{"gt":[49.4]}}},{"1":{"name":{"ct":["Nobody"]}}},{"2":{"stamp":{"bt":[3,9]}}}]},{"name":"view_all","in":"query","style":"form","explode":true,"description":"Get list of all customers","required":false,"schema":{"type":"string","default":true,"example":true}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCustomersResponse"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]},{"ApiKeyAuth":[]}]}},"/merchants/{merchantId}/customers/account/{accountId}":{"get":{"tags":["merchant-customers"],"summary":"Look up a customer and balance by card number","description":"Returns the customer behind a card number, with their balance at the merchant resolved from the API key's user (as for `POST /payments`). `balance.cash_balance` is the spendable stored-value balance (gift card, prepaid and cashless credit combined) as a decimal string in major units: `\"25.50\"` is €25.50. Use it before a `POST /payments` redemption, which takes minor units. An unknown card returns `400` with `Account doesnt exist`; a card with no registered customer returns `200` with `cardStatus: 0` and no `balance`. Accepts an API key with the `customers:read` scope.","operationId":"getUserByAccount","parameters":[{"name":"merchantId","in":"path","description":"Numeric ID of the merchant to get all customers","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"accountId","in":"path","description":"The card number (account number) printed on the card or encoded in the wallet pass QR code","required":true,"schema":{"type":"string","example":12345678}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/MerchantCustomerAccountResponse"},{"type":"object","properties":{"error":{"type":"boolean","default":false},"details":{"type":"object","properties":{"status":{"type":"integer","default":0}}},"cardStatus":{"type":"integer","default":0}}}]}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]},{"ApiKeyAuth":[]}]}},"/merchants/{merchantId}/customers/cards":{"post":{"tags":["merchant-customers"],"summary":"Register a card","description":"Registers a new card OR updates existing card","operationId":"registerCard","requestBody":{"content":{"application/json":{"schema":{"required":["name"],"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"date_of_birth":{"type":"string","format":"date"},"gender":{"type":"string","enum":["male","female","other","unknown"]},"card_number":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterCardResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]},{"ApiKeyAuth":[]}]}},"/merchants/{merchantId}/customers/activate-account":{"put":{"tags":["merchant-customers"],"summary":"Activate Account","description":"activate account OR updates existing account","operationId":"activateAccount","requestBody":{"content":{"application/json":{"schema":{"required":["full_name","email","date_of_birth","gender","loyalty_id","password"],"type":"object","properties":{"full_name":{"type":"string"},"email":{"type":"string"},"date_of_birth":{"type":"string","format":"date"},"gender":{"type":"string","enum":["male","female","other","unknown"]},"loyalty_id":{"type":"string"},"password":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateAccountResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]},{"ApiKeyAuth":[]}]}},"/merchants/{merchantId}/customers/{customerId}":{"get":{"tags":["merchant-customers"],"summary":"Returns a customer details","description":"Returns a specific customer details at a merchant","operationId":"getCustomerById","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"customerId","in":"path","description":"ID of customer","required":true,"schema":{"type":"integer","format":"int64","example":162}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]},{"ApiKeyAuth":[]}]}},"/merchants/{merchantId}/inventory/products":{"get":{"tags":["merchant-inventory-products"],"summary":"Returns a list of Merchant's Inventory Products","operationId":"listMerchantInventoryProducts","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryProductsResponse"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["merchant-inventory-products"],"summary":"Creates an inventory product","operationId":"createProduct","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"required":["branch_id"],"$ref":"#/components/schemas/CreateUpdateProduct"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryProductsPostResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/merchants/{merchantId}/inventory/products/{productId}":{"get":{"tags":["merchant-inventory-products"],"summary":"Returns a product details","description":"Returns a specific product details","operationId":"getProductById","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"productId","in":"path","description":"ID of product","required":true,"schema":{"type":"integer","format":"int64","example":26867041}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryProduct"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]},"put":{"tags":["merchant-inventory-products"],"summary":"Updates a product","operationId":"updateProduct","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"productId","in":"path","description":"ID of product","required":true,"schema":{"type":"integer","format":"int64","example":26867041}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"required":["branch_id"],"$ref":"#/components/schemas/CreateUpdateProduct"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"string","example":"success"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/merchants/{merchantId}/inventory/products/{productId}/image":{"put":{"tags":["merchant-inventory-products"],"summary":"Update image of a product","description":"Updates image on a specific product","operationId":"updateProductImage","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"image":{"type":"string","example":"https://ucarecdn.com/e7bf0263-4e0a-413d-b2b8-3e749474ed1d/-/crop/435x435/128,0/-/preview/"}}}}}},"parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"categoryId","in":"path","description":"ID of category","required":true,"schema":{"type":"integer","format":"int64","example":26867041}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Updated product image"}}}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]},"delete":{"tags":["merchant-inventory-products"],"summary":"Deletes image of a category","description":"Deletes image on a specific category","operationId":"deleteCategoryImage","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"categoryId","in":"path","description":"ID of category","required":true,"schema":{"type":"integer","format":"int64","example":26867041}}],"responses":{"200":{"description":"Successful operation","content":{"text":{"example":"OK"}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/merchants/{merchantId}/inventory/categories":{"get":{"tags":["merchant-inventory-categories"],"summary":"Returns a list of Merchant's Inventory Categories","operationId":"listMerchantInventoryCategories","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryCategoriesResponse"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["merchant-inventory-categories"],"summary":"Updates a category","operationId":"updateCategory","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"required":["branch_id"],"$ref":"#/components/schemas/CreateUpdateCategory"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"string","example":"success"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/merchants/{merchantId}/inventory/categories/{categoryId}":{"get":{"tags":["merchant-inventory-categories"],"summary":"Returns a Categoty details","description":"Returns a specific category details","operationId":"getCategoryById","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"categoryId","in":"path","description":"ID of category","required":true,"schema":{"type":"integer","format":"int64","example":26867041}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryCategory"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]},"put":{"tags":["merchant-inventory-categories"],"summary":"Updates a category","operationId":"updateCategory","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"categoryId","in":"path","description":"ID of category","required":true,"schema":{"type":"integer","format":"int64","example":26867041}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"required":["branch_id"],"$ref":"#/components/schemas/CreateUpdateCategory"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"string","example":"success"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/merchants/{merchantId}/inventory/categories/{categoryId}/image":{"put":{"tags":["merchant-inventory-categories"],"summary":"Update image of a category","description":"Updates image on a specific category","operationId":"updateCategoryImage","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"image":{"type":"string","example":"https://ucarecdn.com/e7bf0263-4e0a-413d-b2b8-3e749474ed1d/-/crop/435x435/128,0/-/preview/"}}}}}},"parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"categoryId","in":"path","description":"ID of category","required":true,"schema":{"type":"integer","format":"int64","example":26867041}}],"responses":{"200":{"description":"Successful operation","content":{"text":{"example":"OK"}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]},"delete":{"tags":["merchant-inventory-categories"],"summary":"Deletes image of a category","description":"Deletes image on a specific category","operationId":"deleteCategoryImage","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"categoryId","in":"path","description":"ID of category","required":true,"schema":{"type":"integer","format":"int64","example":26867041}}],"responses":{"200":{"description":"Successful operation","content":{"text":{"example":"OK"}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/merchants/{merchantId}/inventory/categories/{categoryId}/products":{"get":{"tags":["merchant-inventory-categories"],"summary":"Returns products from a category","description":"Returns a list o products related to a specific category","operationId":"getCategoryProducts","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"categoryId","in":"path","description":"ID of category","required":true,"schema":{"type":"integer","format":"int64","example":26867041}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryCategoryProducts"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]},"put":{"tags":["merchant-inventory-categories"],"summary":"Update products from a category","description":"Updates products on a specific category","operationId":"updateCategoryProducts","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"ordering":{"type":"array","items":{"type":"number"},"example":[46523919,46523920,46523921]}}}}}},"parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"categoryId","in":"path","description":"ID of category","required":true,"schema":{"type":"integer","format":"int64","example":26867041}}],"responses":{"200":{"description":"Successful operation","content":{"text":{"example":"OK"}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/merchants/{merchantId}/inventory/modifiers-groups":{"get":{"tags":["merchant-inventory-modifier-groups"],"summary":"Returns modifier groups","description":"Returns a list of modifier groups","operationId":"getModifierGroups","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryModifierGroups"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["merchant-inventory-modifier-groups"],"summary":"creates a new modifier group","operationId":"createModifierGroup","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryModifierGroupsRequest"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryModifierGroupsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/merchants/{merchantId}/inventory/modifiers-groups/{modifiersGroupId}":{"get":{"tags":["merchant-inventory-modifier-groups"],"summary":"Returns a modifier group","description":"Returns a specific modifier group","operationId":"getModifierGroup","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"modifiersGroupId","in":"path","description":"ID of modifier group","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryModifierGroupResponse"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["merchant-inventory-modifier-groups"],"summary":"Updates a modifier group","operationId":"updateModifierGroup","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"modifiersGroupId","in":"path","description":"ID of modifier group","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"required":["branch_id"],"type":"object","properties":{"name":{"type":"string"},"order":{"type":"number"},"max_allowed":{"type":"number"},"min_required":{"type":"number"},"modifiers":{"$ref":"#/components/schemas/InventoryModifiers"}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"string","example":"success"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/merchants/{merchantId}/inventory/modifiers-groups/{modifiersGroupId}/image":{"put":{"tags":["merchant-inventory-modifier-groups"],"summary":"Updates a modifier group image","operationId":"updateModifierGroupImage","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"modifiersGroupId","in":"path","description":"ID of modifier group","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"image":{"type":"string","example":"https://ucarecdn.com/e7bf0263-4e0a-413d-b2b8-3e749474ed1d/-/crop/435x435/128,0/-/preview/"}}}}}},"responses":{"200":{"description":"Successful operation","content":{"text":{"example":"OK"}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]},"delete":{"tags":["merchant-inventory-modifier-groups"],"summary":"Deletes a modifier group image","operationId":"deleteModifierGroupImage","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"modifiersGroupId","in":"path","description":"ID of modifier group","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"text":{"example":"OK"}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/merchants/{merchantId}/inventory/modifiers-groups/{modifiersGroupId}/products":{"get":{"tags":["merchant-inventory-modifier-groups"],"summary":"Returns a modifier group with its associated products","operationId":"getModifierGroup","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"modifiersGroupId","in":"path","description":"ID of modifier group","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryModifierGroupProductsResponse"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["merchant-inventory-modifier-groups"],"summary":"Returns a modifier group with its associated products","operationId":"getModifierGroup","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"modifiersGroupId","in":"path","description":"ID of modifier group","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"products":{"type":"array","items":{"type":"number"},"example":[45379413,45379414,45379417]}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"string","example":"success"}}}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/merchants/{merchantId}/orders":{"get":{"tags":["merchant-orders"],"summary":"Returns merchant orders","operationId":"getMerchantOrders","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number"},"data":{"$ref":"#/components/schemas/MerchantOrdersResponse"}}}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/merchants/{merchantId}/orders/v2":{"get":{"tags":["merchant-orders"],"summary":"Returns Merchant Orders","operationId":"getMerchantOrdersV2","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number"},"summary":{"type":"object","properties":{"avg_amount":{"type":"number"},"total_amount":{"type":"number"},"total_count":{"type":"number"}}},"data":{"$ref":"#/components/schemas/MerchantOrdersResponse"}}}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/merchants/{merchantId}/orders/products":{"get":{"tags":["merchant-orders"],"summary":"Returns merchant order products","operationId":"getMerchantOrderProducts","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"properties":{"id":{"type":"number"},"name":{"type":"string"},"price":{"type":"number"},"priceType":{"type":"string","enum":["FIXED","variable"]},"quantity":{"type":"number"},"reward":{"type":"number"},"stampReward":{"type":"number"},"taxRateValue":{"type":"number"},"taxRates":{"type":"object","properties":{"elements":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"lineItemRef":{"type":"string"},"name":{"type":"string"},"rate":{"type":"number"}}}}}}}}}}}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/merchants/{merchantId}/reports/gift-cards/liability/kpis":{"get":{"tags":["merchant-reporting"],"summary":"Returns KPI data for gift cards liability report","operationId":"getMerchantLiabilityKPIs","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"franchise_id","in":"query","description":"Filter by Franchise","required":false,"schema":{"type":"integer","minimum":0}},{"name":"start_date","in":"query","description":"Filter by date greater or equals than. In ISO 8601 format","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"end_date","in":"query","description":"Filter by date smaller or equals than. In ISO 8601 format","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","properties":{"credited":{"type":"object","properties":{"total":{"type":"integer","example":375},"volume":{"type":"integer","example":4}}},"debited":{"type":"object","properties":{"total":{"type":"integer","example":0},"volume":{"type":"integer","example":0}}},"expired":{"type":"object","properties":{"total":{"type":"integer","example":0},"volume":{"type":"integer","example":0}}},"balance":{"type":"object","properties":{"total":{"type":"integer","example":375},"volume":{"type":"integer","example":4}}}}}}}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/merchants/{merchantId}/reports/gift-cards/liability":{"get":{"tags":["merchant-reporting"],"summary":"Returns merchant gift cards liability report data","operationId":"getMerchantLiabilityReport","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"franchise_id","in":"query","description":"Filter by Franchise","required":false,"schema":{"type":"integer","minimum":0}},{"name":"start_date","in":"query","description":"Filter by date greater or equals than. In ISO 8601 format","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"end_date","in":"query","description":"Filter by date smaller or equals than. In ISO 8601 format","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"order","in":"query","description":"Field to be used for sorting the list","required":false,"schema":{"type":"string","enum":["voucherNumber","voucherType","creditedBalance","creditedAt","creditedBranch","debitedBalance","debitedAt","debitedBranch","expiryDate","balance"]}},{"name":"direction","in":"query","description":"Sorting direction","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"}},{"name":"exports_to","in":"query","description":"Inform the format to export the data","required":false,"schema":{"type":"string","enum":["csv"]}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"integer","example":142},"voucherNumber":{"type":"string","example":402234773},"voucherType":{"type":"string","enum":["physical","digital"],"example":"physical"},"creditedBalance":{"type":"integer","example":115},"creditedAt":{"type":"string","format":"date-time","example":"2024-09-24T11:39:30.000Z"},"creditedBranch":{"type":"string","example":"Branch Name"},"debitedBalance":{"type":"integer","nullable":true,"example":null},"debitedAt":{"type":"string","format":"date-time","nullable":true,"example":null},"debitedBranch":{"type":"string","nullable":true,"example":null},"expiryDate":{"type":"string","format":"date-time","nullable":true,"example":null},"balance":{"type":"integer","example":115}}}},"total":{"type":"integer","example":49},"totalPages":{"type":"integer","example":5},"currentPage":{"type":"integer","example":1},"perPage":{"type":"integer","example":10}}}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/merchants/{merchantId}/reports/transactions":{"get":{"tags":["reporting"],"summary":"Fetch transaction report from payment gateways","description":"Returns the merchant's card-terminal transactions from the merchant's payment gateway for a date range, merged with Facilipay stored-value redemptions, newest first. Read together with the batch report: the rules below are what reconcile the two.\n\n**Dates** are ISO 8601 instants in UTC and are the gateway's processing time of each transaction, not its settlement time. The range may not exceed 90 days. A batch settles transactions processed on earlier days, so the two reports do not line up by calendar date, and no batch reference or settlement date is exposed on a transaction.\n\n**Voids.** A voided sale is returned as `transactionType: SALE` with `status: VOID` and its original positive amount; the gateway has no separate void type. The batch report's `salesTotal` and `netAmount` exclude voided sales, so exclude `status: VOID` rows when reconciling against it.\n\n**Refunds** carry a negative `totalAmount`. The batch report's `refundsTotal` is the positive sum of the same rows.\n\n**Tips.** `amount.tipAmount` is the tip on that row as processed. The batch report's `tipsTotal` is the gateway's net tip after voids and refunds.\n\n**`transactionTypes`** is applied by the API after fetching, not by the gateway. `VOID` selects rows whose `status` is `VOID`; every other type selects non-voided rows of that type, so `SALE`, `REFUND` and `VOID` partition the gateway rows. A single value or an array is accepted.\n\n**AMEX.** Pass `includeAmex=false` to remove every transaction whose `cardBrand` is `AMEX`. Card brands are normalised before the filter runs, so every spelling the gateway uses for American Express is covered. The filter runs before paging, so `total`, `totalPages` and each page describe the non-AMEX set. Stored-value rows are never affected.\n\n`entryMode` and `authCode` are not provided by the payment gateway's transaction listing and are returned empty. A terminal whose gateway call fails is omitted rather than failing the request. All monetary values are in the smallest currency unit (e.g. cents).\n","operationId":"getMerchantTransactionReport","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"startDate","in":"query","description":"Start date for the report (ISO 8601 format)","required":true,"schema":{"type":"string","format":"date-time","example":"2026-01-01T00:00:00Z"}},{"name":"endDate","in":"query","description":"End date for the report (ISO 8601 format)","required":true,"schema":{"type":"string","format":"date-time","example":"2026-01-31T23:59:59Z"}},{"name":"terminalIds","in":"query","description":"Filter by specific terminal IDs","required":false,"schema":{"type":"array","items":{"type":"string"},"example":["TERM001","TERM002"]}},{"name":"platformName","in":"query","description":"Filter by the terminal platform name configured for the merchant","required":false,"schema":{"type":"string"}},{"name":"transactionTypes","in":"query","description":"Filter by transaction type, applied by the API after fetching. `VOID` matches rows whose status is `VOID` (a voided sale keeps type `SALE`); other values match non-voided rows of that type. A single value or an array is accepted.","required":false,"schema":{"type":"array","items":{"type":"string","enum":["SALE","REFUND","VOID","PREAUTH","CAPTURE","OFFLINE"]},"example":["SALE","REFUND"]}},{"name":"includeAmex","in":"query","description":"Include American Express transactions. `false` removes every row whose `cardBrand` is `AMEX` before paging, so `total` and each page describe the non-AMEX set. Accepted values are `true`, `false`, `1` and `0`; anything else is rejected.","required":false,"schema":{"type":"boolean","default":true}},{"name":"limit","in":"query","description":"Maximum number of results per page (1-1000)","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000,"default":100,"example":50}},{"name":"offset","in":"query","description":"Number of results to skip for pagination","required":false,"schema":{"type":"integer","minimum":0,"default":0,"example":0}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionReportResponse"}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]},{"ApiKeyAuth":[]}]}},"/merchants/{merchantId}/reports/batches":{"get":{"tags":["reporting"],"summary":"Fetch batch report with settlement data","description":"Returns the merchant's closed card-terminal batches for a date range, merged with Facilipay stored-value redemptions (gift cards, prepaid, cashless). Each stored-value redemption is attached to the batch that was trading on its terminal at the time (the earliest batch submitted at or after it); redemptions that match no gateway batch are grouped into a synthetic `Facilipay` batch per terminal. Only redemptions dated inside the window are fetched, while batches are selected by settlement time, so a batch submitted before `startDate` and settled inside the window is listed without the redemptions it was trading before `startDate`, and a batch submitted inside the window but settled after `endDate` is not listed, its redemptions going to the next listed batch on the terminal or to the synthetic batch. Over a full read, `Σ batches[].netAmount = summary.netSalesTotal` and `Σ batches[].transactionCount = summary.gatewayTransactionCount + summary.storedValueRedemptionCount`.\n\n**Dates** are ISO 8601 instants in UTC. The range may not exceed 90 days.\n\n**Pagination.** Batches are sorted newest first by their reference time (`closedAt` when present, otherwise `openedAt`, which is the case while `IN_PROGRESS`) and paged with `limit` and `offset`. `total`, `totalPages` and `summary` describe the whole filtered set, so every page carries the same totals; an `offset` past the end returns an empty `batches` array with the full summary.\n\n**American Express** currently settles in its own batches, so a batch contains either only AMEX transactions or none at all; a batch is classified as AMEX by the card brand of its **first transaction**. The `summary` always breaks out those batches' totals as `gatewayAmexSalesTotal`, `gatewayAmexTipsTotal`, `gatewayAmexRefundsTotal`, `gatewayAmexVoidsTotal` and `gatewayAmexNetAmount`, so the non-AMEX settlement is `gatewayNetAmount − gatewayAmexNetAmount`. Pass `includeAmex=false` to omit AMEX batches from both `batches` and `summary`: the `gatewayAmex*` fields are then zero and the general `gateway*` fields are reduced by exactly the same amounts. Once AMEX settles together with other card brands, these fields are expected to be zero.\n\n**Transactions.** Every per-batch total and the report `summary` come from the gateway's own batch-level totals, not from the transactions array. Pass `includeTransactions=false` for a summary-only response that omits each batch's `transactions` array; totals are unaffected. When included, the array is complete for the batch.\n\n**Voids and net.** The gateway leaves voided sales out of `salesTotal` and `netAmount` and reports them only under `voidsTotal`, so voids are informational and are never subtracted again. Each batch's `netAmount` is the gateway's own settled figure and equals `salesTotal − refundsTotal`. `summary.gatewayNetAmount` is the sum of those per-batch figures; `summary.gatewayAmexNetAmount` is the AMEX share, so the non-AMEX settlement is `gatewayNetAmount − gatewayAmexNetAmount`. Tips are inside every net figure: subtract `tipsTotal` (or `gatewayTipsTotal` / `gatewayAmexTipsTotal`) to get the settlement excluding tips.\n\nA terminal whose gateway call fails is omitted from the response rather than failing the request. All monetary values are in the smallest currency unit (e.g. cents).\n","operationId":"getMerchantBatchReport","parameters":[{"name":"merchantId","in":"path","description":"ID of merchant","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"startDate","in":"query","description":"Start date for the report (ISO 8601 format)","required":true,"schema":{"type":"string","format":"date-time","example":"2026-01-01T00:00:00Z"}},{"name":"endDate","in":"query","description":"End date for the report (ISO 8601 format)","required":true,"schema":{"type":"string","format":"date-time","example":"2026-01-31T23:59:59Z"}},{"name":"terminalIds","in":"query","description":"Filter by specific terminal IDs","required":false,"schema":{"type":"array","items":{"type":"string"},"example":["TERM001","TERM002"]}},{"name":"platformName","in":"query","description":"Filter by the terminal platform name configured for the merchant","required":false,"schema":{"type":"string"}},{"name":"includeLoyalty","in":"query","description":"Include stored value transactions (gift cards, prepaid, cashless) in the report","required":false,"schema":{"type":"boolean","default":true}},{"name":"loyaltyTypes","in":"query","description":"Filter stored value transactions by type","required":false,"schema":{"type":"array","items":{"type":"string","enum":["gift","upfront","cashless","refund"]},"example":["gift","cashless"]}},{"name":"includeAmex","in":"query","description":"Include American Express batches. AMEX currently settles separately, so `false` omits whole batches from both `batches` and `summary`; the `gatewayAmex*` summary fields are then zero and the general `gateway*` fields exclude those batches. A batch is an AMEX batch when its first transaction is AMEX. Accepted values are `true`, `false`, `1` and `0`; anything else is rejected.","required":false,"schema":{"type":"boolean","default":true}},{"name":"includeTransactions","in":"query","description":"Include each batch's `transactions` array. Pass `false` for a summary-only response; per-batch totals and `summary` are unchanged because they come from the gateway's batch-level totals. Accepted values are `true`, `false`, `1` and `0`; anything else is rejected.","required":false,"schema":{"type":"boolean","default":true}},{"name":"limit","in":"query","description":"Maximum number of batches per page (1-1000)","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000,"default":100,"example":50}},{"name":"offset","in":"query","description":"Number of batches to skip for pagination","required":false,"schema":{"type":"integer","minimum":0,"default":0,"example":0}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchReportResponse"}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]},{"ApiKeyAuth":[]}]}},"/inventory/products":{"get":{"tags":["inventory-products"],"summary":"Returns a list of Merchant's Inventory Products","operationId":"listMerchantInventoryProducts","responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryProductsResponse"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]},"post":{"tags":["inventory-products"],"summary":"Creates an inventory product","operationId":"createProduct","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"required":["branch_id"],"$ref":"#/components/schemas/CreateUpdateProduct"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryProductsPostResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/inventory/categories":{"get":{"tags":["inventory-categories"],"summary":"Returns a list of Merchant's Inventory Categories","operationId":"listMerchantInventoryCategories","responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryCategoriesResponse"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]},"post":{"tags":["inventory-categories"],"summary":"Updates a category","operationId":"updateCategory","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"required":["branch_id"],"$ref":"#/components/schemas/CreateUpdateCategory"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"string","example":"success"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/inventory/categories/{categoryId}":{"get":{"tags":["inventory-categories"],"summary":"Returns a categoty details","description":"Returns a specific category details","operationId":"getCategoryById","parameters":[{"name":"categoryId","in":"path","description":"ID of category","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryCategory"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]},"put":{"tags":["inventory-categories"],"summary":"Updates a category","operationId":"updateCategory","parameters":[{"name":"categoryId","in":"path","description":"ID of category","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"required":["branch_id"],"$ref":"#/components/schemas/CreateUpdateCategory"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"string","example":"success"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/inventory/products/{productId}":{"get":{"tags":["inventory-products"],"summary":"Returns a product details","description":"Returns a specific product details","operationId":"getProductById","parameters":[{"name":"productId","in":"path","description":"ID of product","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryProduct"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]},"put":{"tags":["inventory-products"],"summary":"Updates a product","operationId":"updateProduct","parameters":[{"name":"productId","in":"path","description":"ID of product","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"required":["branch_id"],"$ref":"#/components/schemas/CreateUpdateProduct"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"string","example":"success"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/inventory/products/{productId}/image":{"put":{"tags":["inventory-products"],"summary":"Update image of a product","description":"Updates image on a specific product","operationId":"updateProductImage","parameters":[{"name":"productId","in":"path","description":"ID of product","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"image":{"type":"string","example":"https://ucarecdn.com/e7bf0263-4e0a-413d-b2b8-3e749474ed1d/-/crop/435x435/128,0/-/preview/"}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Updated product image"}}}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]},"delete":{"tags":["inventory-products"],"summary":"Deletes image of a category","description":"Deletes image on a specific category","operationId":"deleteCategoryImage","parameters":[{"name":"productId","in":"path","description":"ID of product","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"text":{"example":"OK"}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/inventory/categories/{categoryId}/image":{"put":{"tags":["inventory-categories"],"summary":"Update image of a category","description":"Updates image on a specific category","operationId":"updateCategoryImage","parameters":[{"name":"categoryId","in":"path","description":"ID of category","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"image":{"type":"string","example":"https://ucarecdn.com/e7bf0263-4e0a-413d-b2b8-3e749474ed1d/-/crop/435x435/128,0/-/preview/"}}}}}},"responses":{"200":{"description":"Successful operation","content":{"text":{"example":"OK"}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]},"delete":{"tags":["inventory-categories"],"summary":"Deletes image of a category","description":"Deletes image on a specific category","operationId":"deleteCategoryImage","parameters":[{"name":"categoryId","in":"path","description":"ID of category","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"text":{"example":"OK"}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/inventory/categories/{categoryId}/products":{"get":{"tags":["inventory-categories"],"summary":"Returns products from a category","description":"Returns a list o products related to a specific category","operationId":"getCategoryProducts","parameters":[{"name":"categoryId","in":"path","description":"ID of category","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryCategoryProducts"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]},"put":{"tags":["inventory-categories"],"summary":"Update products from a category","description":"Updates products on a specific category","operationId":"updateCategoryProducts","parameters":[{"name":"categoryId","in":"path","description":"ID of category","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"ordering":{"type":"array","items":{"type":"number"},"example":[46523919,46523920,46523921]}}}}}},"responses":{"200":{"description":"Successful operation","content":{"text":{"example":"OK"}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/inventory/modifiers-groups":{"get":{"tags":["inventory-modifier-groups"],"summary":"Returns modifier groups","description":"Returns a list of modifier groups","operationId":"getModifierGroups","responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryModifierGroups"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]},"post":{"tags":["inventory-modifier-groups"],"summary":"creates a new modifier group","operationId":"createModifierGroup","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryModifierGroupsRequest"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryModifierGroupsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/inventory/modifiers-groups/{modifiersGroupId}":{"get":{"tags":["inventory-modifier-groups"],"summary":"Returns a modifier group","description":"Returns a specific modifier group","operationId":"getModifierGroup","parameters":[{"name":"modifiersGroupId","in":"path","description":"ID of modifier group","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryModifierGroupResponse"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]},"put":{"tags":["inventory-modifier-groups"],"summary":"Updates a modifier group","operationId":"updateModifierGroup","parameters":[{"name":"modifiersGroupId","in":"path","description":"ID of modifier group","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"required":["branch_id"],"type":"object","properties":{"name":{"type":"string"},"order":{"type":"number"},"max_allowed":{"type":"number"},"min_required":{"type":"number"},"modifiers":{"$ref":"#/components/schemas/InventoryModifiers"}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"string","example":"success"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/inventory/modifiers-groups/{modifiersGroupId}/image":{"put":{"tags":["inventory-modifier-groups"],"summary":"Updates a modifier group image","operationId":"updateModifierGroupImage","parameters":[{"name":"modifiersGroupId","in":"path","description":"ID of modifier group","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"image":{"type":"string","example":"https://ucarecdn.com/e7bf0263-4e0a-413d-b2b8-3e749474ed1d/-/crop/435x435/128,0/-/preview/"}}}}}},"responses":{"200":{"description":"Successful operation","content":{"text":{"example":"OK"}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]},"delete":{"tags":["inventory-modifier-groups"],"summary":"Deletes a modifier group image","operationId":"deleteModifierGroupImage","parameters":[{"name":"modifiersGroupId","in":"path","description":"ID of modifier group","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"text":{"example":"OK"}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/inventory/modifiers-groups/{modifiersGroupId}/products":{"get":{"tags":["inventory-modifier-groups"],"summary":"Returns a modifier group with its associated products","operationId":"getModifierGroup","parameters":[{"name":"modifiersGroupId","in":"path","description":"ID of modifier group","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryModifierGroupProductsResponse"}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]},"put":{"tags":["inventory-modifier-groups"],"summary":"Returns a modifier group with its associated products","operationId":"getModifierGroup","parameters":[{"name":"modifiersGroupId","in":"path","description":"ID of modifier group","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"products":{"type":"array","items":{"type":"number"},"example":[45379413,45379414,45379417]}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"string","example":"success"}}}}}},"400":{"description":"Invalid merchant id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Merchant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns":{"get":{"tags":["campaigns"],"summary":"Returns a list of campaigns","operationId":"returnCampaigns","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"pagination":{"type":"object","properties":{"has_more_pages":{"type":"boolean"},"items_per_page":{"type":"number"},"page":{"type":"number"},"total_items":{"type":"number"}}},"list":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"picture_url":{"type":"string"},"advertising":{"type":"boolean"},"coupons_quantity":{"type":"number"},"created_at":{"type":"string","format":"date"},"updated_at":{"type":"string","format":"date"},"description":{"type":"string"},"highlight":{"type":"boolean"},"status":{"type":"string","enum":["draft","running","paused","ended"]},"terms_and_conditions":{"type":"string"},"schedules":{"$ref":"#/components/schemas/CampaignSchedules"},"rewards_value":{"type":"number"},"limits":{"$ref":"#/components/schemas/CampaignLimits"}}}}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}":{"get":{"tags":["campaigns"],"summary":"Returns a campaign","operationId":"returnCampaign","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"picture_url":{"type":"string"},"advertising":{"type":"boolean"},"coupons_quantity":{"type":"number"},"created_at":{"type":"string","format":"date"},"updated_at":{"type":"string","format":"date"},"description":{"type":"string"},"highlight":{"type":"boolean"},"status":{"type":"string","enum":["draft","running","paused","ended"]},"terms_and_conditions":{"type":"string"},"schedules":{"$ref":"#/components/schemas/CampaignSchedules"},"rewards":{"type":"object","properties":{"discount_product":{"type":"object","properties":{"item_limit":{"type":"number"},"value":{"type":"number"},"value_type":{"type":"string","enum":["money","percent"]},"selector":{"type":"object","properties":{"date":{"type":"string","format":"date"},"productsSelection":{"$ref":"#/components/schemas/InventoryProductsSelection"},"categoriesSelection":{"$ref":"#/components/schemas/InventoryCategoriesSelection"}}}}}}},"rules":{"type":"object","properties":{"products":{"type":"object","properties":{"values":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"string","example":"6"},"period_type":{"type":"string","enum":["day","week","month","year"]},"period_value":{"type":"number"},"selector":{"type":"object","properties":{"productsSelection":{"$ref":"#/components/schemas/InventoryProductsSelection"},"categoriesSelection":{"$ref":"#/components/schemas/InventoryCategoriesSelection"}}}}}}}},"gender":{"type":"object","properties":{"values":{"type":"array","items":{"type":"string","enum":["female","male","unknown"]}}}},"age":{"type":"object","properties":{"values":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","example":"10"},"end":{"type":"string","example":"13"}}}}}},"customer_domains":{"type":"object","properties":{"values":{"type":"array","items":{"type":"string","example":"loylap.com"}}}},"birthday":{"type":"object","properties":{"value":{"type":"string","enum":["month_of_birthday","week_of_birthday","days_around","day_of_birthday"]}}},"lapsed_customers":{"type":"object","properties":{"value":{"type":"object","properties":{"period":{"type":"string","enum":["day","week","month"]},"value":{"type":"number"}}}}},"cake_day":{"type":"object","properties":{"value":{"type":"object","properties":{"period":{"type":"string","enum":["day","week","month"]},"value":{"type":"number"}}}}},"visits":{"type":"object","properties":{"values":{"type":"array","items":{"type":"object","properties":{"period_type":{"type":"string","enum":["day","week","year"]},"period_value":{"type":"number"},"recurring_type":{"type":"string","example":"day"},"recurring_value":{"type":"number"},"value":{"type":"string","example":"2"},"value_type":{"type":"string","example":"total"}}}}}},"transaction_types":{"type":"object","properties":{"values":{"type":"object","properties":{"amount":{"type":"number"},"period_type":{"type":"string","enum":["day","week","month"]},"period_value":{"type":"number"},"types":{"type":"array","items":{"type":"string","maximum":5,"enum":["add","remove","gift","cash","stamp","cashless","vend","upfront"]}}}}}},"spent":{"type":"object","properties":{"values":{"type":"array","items":{"type":"object","properties":{"period_type":{"type":"string","enum":["day","week","month","year"]},"period_value":{"type":"number"},"recurring_type":{"type":"string","example":"day"},"recurring_value":{"type":"number"},"value":{"type":"string","example":"1300"}}}}}},"top_visitors":{"type":"object","properties":{"values":{"type":"array","items":{"type":"object","properties":{"period_value":{"type":"number"},"period_type":{"type":"string","enum":["day","week","month","year"]},"amount":{"type":"number"}}}}}},"top_spenders":{"type":"object","properties":{"values":{"type":"array","items":{"type":"object","properties":{"period_value":{"type":"number"},"period_type":{"type":"string","enum":["day","week","month","year"]},"amount":{"type":"number"}}}}}},"role":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","example":["3","344","361"]}}}},"branches":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","example":["5699","2878","1293"]}}}},"customers":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","example":["23597201","23667806"]}}}}}},"rewards_value":{"type":"number"},"notification":{"type":"object","properties":{"id":{"type":"number"},"campaign_id":{"type":"number"},"picture_url":{"type":"string"},"enabled":{"type":"boolean"},"general_message":{"type":"string"},"general_message_date":{"type":"string","format":"date","example":"2023-06-22T09:15:29.790Z"},"general_message_enabled":{"type":"boolean"},"general_title":{"type":"string"},"applicable_customers_message":{"type":"string"},"applicable_customers_message_enabled":{"type":"boolean"},"applicable_customers_title":{"type":"string"},"applicable_customers_notification_event":{"type":"string","enum":["once_applicable","10_min_after","8am_following_day"]}}},"limits":{"$ref":"#/components/schemas/CampaignLimits"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/notifications":{"put":{"tags":["campaigns"],"summary":"Updates a campaign notification","operationId":"updateCampaignNotification","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"general_message":{"type":"string"},"general_message_date":{"type":"string","format":"date","example":"2023-06-22T09:15:29.790Z"},"general_message_enabled":{"type":"boolean"},"general_title":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/highlight":{"put":{"tags":["campaigns"],"summary":"Updates a campaign highlight","operationId":"updateCampaignHighlight","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/status":{"put":{"tags":["campaigns"],"summary":"Updates a campaign status","operationId":"updateCampaignStatus","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["draft","running","paused","ended"]}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/basic":{"put":{"tags":["campaigns"],"summary":"Updates a campaign","operationId":"updateCampaign","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"advertising":{"type":"boolean"},"description":{"type":"string"},"name":{"type":"string"},"picture_url":{"type":"string"},"terms_and_conditions":{"type":"string"},"schedules":{"$ref":"#/components/schemas/CampaignSchedules"},"limits":{"$ref":"#/components/schemas/CampaignLimits"}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/transactions":{"get":{"tags":["campaigns"],"summary":"Returns a campaign transactions","operationId":"returnCampaignTransactions","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}},{"name":"exports_to","in":"query","description":"Export format. When set to 'csv', returns a URL to the exported file instead of paginated data.","required":false,"schema":{"type":"string","enum":["csv"]}},{"name":"transform","in":"query","description":"Transformation script to apply to the exported CSV. Produces an XLSX report. Only used when exports_to=csv.","required":false,"schema":{"type":"string","enum":["campaign_weekly_report","campaign_monthly_report"]}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"oneOf":[{"type":"object","description":"Paginated transaction data (default)","properties":{"total":{"type":"number","example":54},"data":{"type":"array","items":{"type":"object","properties":{"user_name":{"type":"string"},"user_id":{"type":"number"},"total":{"type":"number"},"reward_type":{"type":"string","enum":["discount","discount_product","cashback","topup"]},"created_at":{"type":"string","format":"date"}}}}}},{"type":"object","description":"Export file URL (when exports_to=csv)","properties":{"data":{"type":"string","description":"URL to the exported CSV or transformed XLSX file","example":"https://s3-eu-west-1.amazonaws.com/bucket/02/11/campaign_transactions_abc123.csv"}}}]}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/stats":{"get":{"tags":["campaigns"],"summary":"Returns a campaign stats","operationId":"returnCampaignStats","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"has_some_transaction":{"type":"boolean"},"charts":{"type":"object","properties":{"coupons_and_rewards_stats":{"type":"object","properties":{"type":{"type":"string","enum":["hours","days","months"]},"data":{"type":"array","items":{"type":"object","properties":{"data":{"type":"object","properties":{"total_rewards_value":{"type":"number"},"used_coupons":{"type":"number"}}},"interval_dates":{"type":"array","items":{"type":"string","format":"date","example":["2023-06-10T16:00:00.000Z","2023-06-14T19:59:00.000Z"]}}}}}}}}},"general":{"type":"object","properties":{"impacted_customers":{"type":"number"},"remaining_budget_percentage":{"type":"number"},"remaining_coupons_percentage":{"type":"number"},"spent_budget":{"type":"number"},"spent_coupons":{"type":"number"}}}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rules/gender":{"put":{"tags":["campaign-rules"],"summary":"Updates a campaign gender rule","operationId":"updateCampaignGenderRule","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"values":{"type":"string","enum":["male","female","unknown"]}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rules/age":{"put":{"tags":["campaign-rules"],"summary":"Updates a campaign age rule","operationId":"updateCampaignAgeRule","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"values":{"type":"array","items":{"type":"object","properties":{"start":{"type":"number"},"end":{"type":"number"}}}}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rules/customer_domains":{"put":{"tags":["campaign-rules"],"summary":"Updates a campaign customer domains rule","operationId":"updateCampaignCustomerDomainsRule","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"values":{"type":"array","items":{"type":"string","example":["loylap.com"]}}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rules/birthday":{"put":{"tags":["campaign-rules"],"summary":"Updates a campaign birthday rule","operationId":"updateCampaignBirthdayRule","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"value":{"type":"string","enum":["week_of_birthday","month_of_birthday","days_around","day_of_birthday"]}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rules/lapsed_customers":{"put":{"tags":["campaign-rules"],"summary":"Updates a campaign lapsed customers rule","operationId":"updateCampaignLapsedCustomersRule","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"value":{"type":"number"},"period":{"type":"string","enum":["day","week","month"]}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rules/cake_day":{"put":{"tags":["campaign-rules"],"summary":"Updates a campaign cake day rule","operationId":"updateCampaignCakeDayRule","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"value":{"type":"object","properties":{"period":{"type":"string","enum":["day","week","month"]},"value":{"type":"number"}}}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rules/visits":{"put":{"tags":["campaign-rules"],"summary":"Updates a campaign visits rule","operationId":"updateCampaignVisitsRule","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"values":{"type":"object","properties":{"period_type":{"type":"string","enum":["day","week","month","year"]},"period_value":{"type":"number"},"recurring_type":{"type":"string"},"recurring_value":{"type":"number"},"value":{"type":"number"},"value_type":{"type":"string"}}}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rules/spent":{"put":{"tags":["campaign-rules"],"summary":"Updates a campaign spent rule","operationId":"updateCampaignSpentRule","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"values":{"type":"object","properties":{"value":{"type":"number"},"recurring_value":{"type":"number"},"recurring_type":{"type":"string"},"period_value":{"type":"number"},"period_type":{"type":"string","enum":["day","week","month","year"]}}}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rules/products":{"put":{"tags":["campaign-rules"],"summary":"Updates a campaign products rule","operationId":"updateCampaignProductsRule","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"values":{"type":"object","properties":{"amount":{"type":"string","example":"6"},"period_type":{"type":"string","enum":["day","week","month","year"]},"period_value":{"type":"number"},"selector":{"type":"object","properties":{"productsSelection":{"$ref":"#/components/schemas/InventoryProductsSelection"},"categoriesSelection":{"$ref":"#/components/schemas/InventoryCategoriesSelection"}}}}}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rules/top_visitors":{"put":{"tags":["campaign-rules"],"summary":"Updates a campaign top visitors rule","operationId":"updateCampaignTopVisitorsRule","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"values":{"type":"object","properties":{"period_value":{"type":"number"},"period_type":{"type":"string","enum":["day","week","month","year"]},"amount":{"type":"number"}}}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rules/top_spenders":{"put":{"tags":["campaign-rules"],"summary":"Updates a campaign top spenders rule","operationId":"updateCampaignTopSpendersRule","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"values":{"type":"object","properties":{"period_value":{"type":"number"},"period_type":{"type":"string","enum":["day","week","month","year"]},"amount":{"type":"number"}}}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rules/role":{"put":{"tags":["campaign-rules"],"summary":"Updates a campaign role rule","operationId":"updateCampaignRoleRule","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","example":["361"]}}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rules/branches":{"put":{"tags":["campaign-rules"],"summary":"Updates a campaign branches rule","operationId":"updateCampaignBranchesRule","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","example":["1293","4995"]}}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rules/customers":{"put":{"tags":["campaign-rules"],"summary":"Updates a campaign customers rule","operationId":"updateCampaignCustomersRule","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","example":["23597201","23667805"]}}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rules/transaction_types":{"put":{"tags":["campaign-rules"],"summary":"Updates a campaign transaction types rule","operationId":"updateCampaignTransactionTypesRule","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"amount":{"type":"number"},"period_type":{"type":"string","enum":["day","week","month"]},"period_value":{"type":"string","example":"1"},"types":{"type":"array","items":{"type":"string","maximum":5,"enum":["add","remove","gift","cash","stamp","cashless","vend","upfront"]}}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rewards/discount":{"put":{"tags":["campaign-rewards"],"summary":"Updates a campaign discount reward","operationId":"updateCampaignDiscountReward","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"sales_value":{"type":"number"},"value":{"type":"number"},"value_type":{"type":"string","enum":["percent","money"]}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rewards/discount_product":{"put":{"tags":["campaign-rewards"],"summary":"Updates a campaign discount_product reward","operationId":"updateCampaignDiscountProductReward","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"item_limit":{"type":"string","example":"2"},"value":{"type":"number"},"value_type":{"type":"string","enum":["percent","money"]},"selector":{"type":"object","properties":{"productsSelection":{"$ref":"#/components/schemas/InventoryProductsSelection"},"categoriesSelection":{"$ref":"#/components/schemas/InventoryCategoriesSelection"}}}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rewards/cashback":{"put":{"tags":["campaign-rewards"],"summary":"Updates a campaign cashback reward","operationId":"updateCampaignCashbackReward","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"sales_value":{"type":"number"},"value":{"type":"number"},"value_type":{"type":"string","enum":["percent","money"]}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/campaigns/{campaignId}/rewards/voucher":{"put":{"tags":["campaign-rewards"],"summary":"Updates a campaign voucher reward","operationId":"updateCampaignCVoucherReward","parameters":[{"name":"campaignId","in":"path","description":"ID of campaign","required":true,"schema":{"type":"integer","format":"int64","example":253}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"amount":{"type":"number"}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"}}}}}},"400":{"description":"Invalid campaign id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}},"/payments":{"post":{"tags":["payment"],"summary":"Redeem or load stored value on a customer's card","description":"Debits or credits a customer's stored-value balance. A gift card redemption is `payment_type=gift` with a **negative** `amount`; a positive amount loads value. See \"Redeem gift cards at a point of sale\" in the introduction for the full flow.\n\nThe merchant is resolved from the user who created the API key (their first owned merchant), not from `merchant_id`.\n\nDeprecated: this endpoint will be replaced by an order-based endpoint; requests that pass validation get `Deprecation` and `Sunset` headers. It is not idempotent, and it returns `401` for an insufficient balance as well as for authentication failures.\n","operationId":"createPaymentProcessing","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"required":["payment_type","customer_id","amount"],"type":"object","properties":{"payment_type":{"type":"string","description":"`gift` redeems (negative amount) or loads (positive amount) stored value at face value. `upfront` and `cashless` load stored value and add the merchant's top-up bonus. `cash` records a sale paid by other means and awards cashback. `stamp` adds or removes loyalty stamps.","enum":["cash","stamp","upfront","gift","cashless"]},"merchant_id":{"type":"string","description":"Optional external merchant id from your POS or terminal provider, used only to attribute the transaction to the matching branch. It does not choose the merchant that is debited. Leave it out unless Facilipay support has given you a value; without it the employee's branch is used."},"customer_id":{"type":"string","description":"The card number (account number) printed on the card or encoded in the wallet pass QR code. Not the customer's numeric id.","example":"12345678"},"amount":{"type":"integer","format":"int64","description":"Amount in minor units (cents): €25.50 is 2550. Negative to redeem, positive to load. For `stamp`, the number of stamps.","example":-2550},"identifier":{"type":"string","description":"Your reference for this transaction, unique per sale (e.g. a receipt number). Look a payment up by it with `GET /merchants/{merchantId}/transactions/byUniqueId/{uniqueIdentifier}`.","example":"POS-1042-000731"},"employee_email":{"type":"string","description":"Email of the merchant employee taking the payment, recorded on the transaction. Defaults to the API key's user."},"product_data":{"type":"string"},"skip_cashback":{"type":"boolean"},"cashback_rewards":{"type":"string"},"terminal_id":{"type":"string","description":"Your till or terminal id, stored on the transaction."}}}}}},"responses":{"200":{"description":"Transaction processed. The response does not include the new balance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentResponse"}}}},"400":{"description":"Validation failed, unknown card (`Account doesnt exist`), expired card, or the API key's user is not an employee of the merchant (`Invalid parameters`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"boolean","example":true},"message":{"type":"string","example":"Account doesnt exist"}}}}}},"401":{"description":"Invalid or expired credentials, OR the balance is too low (`INSUFFICIENT BALANCE`; nothing was debited), OR the card is blocked or expired. Read `message` before treating it as an authentication failure.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"boolean","example":true},"message":{"type":"string","example":"INSUFFICIENT BALANCE"}}}}}},"403":{"description":"The API key lacks the `payments:write` scope, or the customer is blocked at this merchant.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"API key lacks required scope: payments:write"}}}}}},"422":{"description":"The API key's user is not linked to a merchant.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Merchant not found"}}}}}},"500":{"description":"Unexpected error, including a lost connection to the payment service mid-request. The debit may or may not have happened; wait a minute and check with `GET /merchants/{merchantId}/transactions/byUniqueId/{identifier}` before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"502":{"description":"The payment service could not be reached or failed upstream. The debit may or may not have happened; wait a minute and check with `GET /merchants/{merchantId}/transactions/byUniqueId/{identifier}` before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}},"security":[{"authorization":[]},{"ApiKeyAuth":[]}]}},"/gift-card/digital/send":{"post":{"tags":["gift-cards"],"summary":"Send digital giftcard","description":"Sends an electronic gift card to a user email from the merchant","operationId":"digitalGiftcard","requestBody":{"content":{"application/json":{"schema":{"required":["loyalty_type","amount","sender_name","employee_email","recipient_email","recipient_name"],"type":"object","properties":{"loyalty_type":{"type":"string","example":"gift"},"merchant_id":{"type":"integer","format":"int64","description":"Merchant the voucher is sent for. Must be a merchant the token holds a merchant or employee permission for (403 otherwise). Defaults to the token's merchant."},"card_number":{"type":"string"},"identifier":{"type":"string","example":"645e464ba7cc1 | Insertion time: 16838999796 | Customer ID: 554046543 | Amount: 200"},"product_data":{"type":"string"},"message":{"type":"string"},"sender_name":{"type":"string","example":"Nobody"},"recipient_name":{"type":"string","example":"Nobody"},"employee_email":{"type":"string","example":"Nobody@facilipay.io"},"recipient_email":{"type":"string","example":"Nobody@facilipay.io"},"sender_email":{"type":"string","example":"Nobody@facilipay.io"}}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"boolean","example":false},"message":{"type":"string","example":"Email sent successfully"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid authentication","content":{}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"authorization":[]}]}}},"components":{"schemas":{"Balance":{"type":"object","properties":{"cash":{"type":"integer","default":0},"stamps":{"type":"integer","default":0},"maxStamps":{"type":"integer","default":0,"example":10},"creditAllowed":{"type":"boolean"}}},"Branch":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":4474},"name":{"type":"string","example":"Spire's Branch"},"address":{"type":"string","example":"0954 Heather Via Apt. 755"},"lat":{"type":"string","example":78.5098},"lng":{"type":"string","example":-153.7968},"phone":{"type":"string","example":"961 770 7727"},"opening_hours":{"type":"string","description":"A JSON stringified","example":"[{\"day\":\"Saturday\",\"from\":\"00:00\",\"to\":\"23:59\",\"isOpen\":false},{\"day\":\"Thursday\",\"from\":\"00:00\",\"to\":\"23:59\",\"isOpen\":false},{\"day\":\"Friday\",\"from\":\"00:00\",\"to\":\"23:59\",\"isOpen\":false},{\"day\":\"Sunday\",\"from\":\"00:00\",\"to\":\"00:00\",\"isOpen\":false},{\"day\":\"Monday\",\"from\":\"08:00\",\"to\":\"23:00\",\"isOpen\":false}]"},"delivery_type":{"type":"string","default":null,"enum":[null,"both","collection","delivery","none","pickup"]},"external_merchant_id":{"type":"string","example":"9BFO4O39GQZ435"},"estimated_delivery":{"type":"string","default":null},"estimated_collection":{"type":"string","default":null},"group_id":{"type":"integer","format":"int64","example":201},"status":{"type":"integer","enum":[0,1]},"is_phone_number_required_for_ordering":{"type":"boolean","default":false},"fixed_delivery_name":{"type":"string"},"max_delivery_distance":{"type":"number","default":0},"delivery":{"type":"boolean","default":false},"tip":{"type":"boolean","default":false},"hide_calendar":{"type":"boolean","default":false},"ordering":{"type":"integer","enum":[0,1]},"prep_time":{"type":"number","example":50},"add_utensils":{"type":"integer","default":0},"delivery_time":{"type":"string","default":0},"fixed_delivery_time":{"type":"string","default":0},"delivery_addresses":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryAddress"}},"delivery_fee":{"type":"integer","default":0},"fixed_delivery_fee":{"type":"integer","default":null},"waive_fixed_delivery_fee":{"type":"string","default":null},"waive_delivery_fee":{"type":"string","default":null},"minimum_order_collection":{"type":"string","default":0},"minimum_order_delivery":{"type":"string","default":0},"minimum_order_fixed_delivery":{"type":"string","default":0},"ordering_unavailable_until":{"type":"string","default":null},"hide_dispatch_time":{"type":"boolean","default":false},"ordering_welcome_message":{"type":"string","default":null},"modifierGroupsScroll":{"type":"boolean","default":false},"autoAcceptOrders":{"type":"boolean","default":false},"collection":{"$ref":"#/components/schemas/Delivery"},"Delivery":{"$ref":"#/components/schemas/Delivery"},"fixed-delivery":{"$ref":"#/components/schemas/Delivery"}}},"Delivery":{"type":"object","properties":{"dispatch_slots":{"type":"boolean","default":false}}},"DeliveryAddress":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":2},"user_id":{"type":"integer","format":"int64","default":null},"group_id":{"type":"integer","format":"int64","example":201},"branch_id":{"type":"integer","format":"int64","example":234},"is_primary":{"type":"boolean"},"country":{"type":"string","default":null},"postal_code":{"type":"string","default":null},"region":{"type":"string","default":null},"city":{"type":"string","default":null},"locality":{"type":"string","default":null},"line_1":{"type":"string","example":"Room 1","default":null},"line_2":{"type":"string","default":null},"line_3":{"type":"string","default":null}}},"Employee":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":574},"name":{"type":"string","example":"John nobody"},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Nobody"},"status":{"type":"string","enum":["enabled","disabled"]},"permissions":{"type":"string","enum":["basic","admin"]},"role":{"type":"string","enum":["basic","manager","admin"]},"branch":{"type":"object","properties":{"name":{"type":"string","example":"Spire's Branch"}}}}},"Location":{"type":"object","properties":{"address":{"type":"string","example":"Pickering, ON, Canada"},"lat":{"type":"string","example":-2.9114},"lng":{"type":"string","example":-117.2256},"country":{"type":"string","example":"CA"},"zip":{"type":"string","example":30262},"city":{"type":"string","example":"West Darronfort"}}},"Loyalty":{"type":"object","properties":{"loyalty_type":{"type":"string","enum":["stamp","cash"]},"maximum_reward_value":{"type":"integer","example":0},"stamp_number":{"type":"integer","example":10},"base_reward":{"type":"number","example":10},"maximum_credit_allowance":{"type":"number","example":5000},"terms_and_conditions":{"type":"string"},"tier_type":{"type":"string","enum":["spend","visits"]},"expiry_days":{"type":"integer","example":0},"preauthorised":{"type":"boolean","example":true},"tiers":{"type":"object","properties":{"stamp":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"integer","example":10},"reward":{"type":"integer","default":""}}}},"credit":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"integer","example":500},"reward":{"type":"integer","example":20}}}},"upfront":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"integer","default":""},"reward":{"type":"integer","example":9}}}}}}}},"Merchant":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":217},"name":{"type":"string","example":"Nobodys Store"},"caterer":{"type":"boolean"},"group_admin_email":{"type":"string","example":"admin@example.com"},"short_name":{"type":"string","example":"Nobodys Store"},"email":{"type":"string","example":"store@nobodys.com"},"phone":{"type":"string","example":"961 770 7727"},"website":{"type":"string","example":"https://www.loylap.com"},"url":{"type":"string","example":"https://nobodys.loylap.com"},"slug":{"type":"string","example":"nobodys"},"category":{"type":"integer","format":"int64","example":"1495,"},"category_name":{"type":"string","example":"Video Game Arcades/Establishments"},"visible":{"type":"string","default":1,"enum":[0,1]},"status":{"type":"integer","default":1,"enum":[0,1]},"access_level":{"type":"integer","default":0},"established":{"type":"string","format":"date-time"},"location":{"$ref":"#/components/schemas/Location"},"isEnrolled":{"type":"boolean"},"isParent":{"type":"boolean"},"features":{"type":"object","properties":{"topup":{"type":"boolean","example":true},"integrations":{"type":"object","properties":{"aibms":{"type":"boolean","example":false},"aibms_id":{"type":"string"},"stripe":{"type":"boolean","example":true},"stripe_id":{"type":"string","example":"8P9KC4AW3N8FSP4LLTZN"},"judopay":{"type":"boolean","example":false},"judopay_id":{"type":"string"},"clover_ecomm":{"type":"boolean","example":false},"clover_ecomm_id":{"type":"string"}}}}},"photos":{"type":"object","properties":{"group_photo":{"type":"string"},"img1":{"type":"string"},"img2":{"type":"string"},"img3":{"type":"string"},"img4":{"type":"string"}}},"branches":{"type":"array","items":{"$ref":"#/components/schemas/Branch"}},"employees":{"type":"array","items":{"$ref":"#/components/schemas/Employee"}},"franchise":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":231},"name":{"type":"string","example":"Franchise 1"}}}},"roles":{"type":"array","items":{"type":"string"},"example":["Managers","Employee","Member"]},"loyaltyRoles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":361},"name":{"type":"string","example":"Managers"}}}},"settings":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}},"plan":{"$ref":"#/components/schemas/Plan"},"cardDetails":{"type":"object","properties":{"card_brand":{"type":"string","example":"Visa"},"last_four":{"type":"string","example":3436},"expiry_date":{"type":"string","example":"12/26"}},"default":null},"loyalty":{"$ref":"#/components/schemas/Loyalty"},"balance":{"$ref":"#/components/schemas/Balance"},"topup":{"type":"object","properties":{"auto":{"type":"boolean"},"value":{"type":"integer"}}},"paymentAccounts":{"type":"array","items":{"$ref":"#/components/schemas/PaymentAccounts"}},"posTokens":{"type":"object","properties":{"clover":{"type":"object","properties":{"hasSelfCheckoutAccessToken":{"type":"boolean","example":true}}}}}}},"Campaigns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":23145},"status":{"type":"string","example":"running"},"name":{"type":"string","example":"Super campaign"},"description":{"type":"string","example":"Some description"},"terms":{"type":"string","example":"Some terms and conditions"},"picture":{"type":"string","example":"image url"},"schedule_period_start":{"type":"string","format":"date","default":null},"schedule_period_end":{"type":"string","format":"date","default":null},"limits_budget":{"type":"integer","format":"int64","default":null},"limits_coupons":{"type":"integer","format":"int64","default":null},"limits_coupons_user":{"type":"integer","format":"int64","default":null},"limits_coupons_user_type":{"type":"string","default":null},"limits_value_user":{"type":"integer","format":"int64","default":null},"limits_value_user_type":{"type":"string","default":null},"limits_budget_email":{"type":"boolean","example":false},"limits_coupons_email":{"type":"boolean","example":false},"highlight":{"type":"boolean","example":true},"advertising":{"type":"boolean","example":true},"createdAt":{"type":"string","format":"date"},"updatedAt":{"type":"string","format":"date"},"transactions":{"type":"array","items":{"type":"object","properties":{"rewards_value":{"type":"integer","format":"int64","example":7003922165},"coupons_quantity":{"type":"integer","format":"int64","example":2346234}}}},"rewards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":12345},"campaign_id":{"type":"integer","format":"int64","example":12345},"type":{"type":"string","example":"discount product"},"value_type":{"type":"string","example":"percent"},"value":{"type":"integer","format":"int64","example":200},"sales_value":{"type":"integer","format":"int64","example":10,"default":0},"amount":{"type":"integer","format":"int64","example":200,"default":0},"products_selection":{"type":"string","example":"{\"productsSelection\":[{\"productId\":\"26897342\",\"modifiersIdsExclusionList\":[\"1427663\"]}],\"categoriesSelection\":[]}"},"item_limit":{"type":"integer","format":"int64","example":3}}}},"schedule_days":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":123},"campaign_id":{"type":"integer","format":"int64","example":12345},"day":{"type":"string","example":"monday"}}}},"schedule_periods":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":123},"campaign_id":{"type":"integer","format":"int64","example":12345},"period":{"type":"string","example":"morning"}}}}}}},"MerchantSummarized":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":217},"name":{"type":"string","example":"Nobodys Store"},"employee":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":174},"permissions":{"type":"string","example":"admin"}}},"branch":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":369}}}}},"Plan":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":1391},"is_active":{"type":"integer","example":1},"group_id":{"type":"integer","format":"int64","example":201},"name":{"type":"string","example":"Starter"},"description":{"type":"string","example":"Advanced Loyalty with POS Integration"},"type":{"type":"string","example":"general"},"loylap_plan":{"type":"string","example":"Starter"},"extend_plan":{"type":"string","example":"Free"},"country":{"type":"string","example":"US"},"subscription_fee":{"type":"number","example":0.1},"transaction_fee_gift":{"type":"number","example":0},"transaction_fee_upfront":{"type":"number","example":0},"transaction_charge_gift":{"type":"number","example":0},"transaction_charge_upfront":{"type":"number","example":0},"ordering_fee":{"type":"number","example":0},"branch_charge":{"type":"number","example":0},"device_charge":{"type":"number","example":0},"free_transaction_value":{"type":"number","example":500},"trial_days":{"type":"integer","example":7},"remaining_trial_days":{"type":"integer","example":0},"last_billed":{"type":"string","format":"date","default":null},"next_bill_date_to_charge":{"type":"string","format":"date"},"acquirer":{"type":"string","default":null},"gateway":{"type":"string","default":null},"is_direct_debit":{"type":"integer","enum":[0,1]},"is_invoiced_manually":{"type":"integer","default":null,"enum":[0,1]},"is_best_investment":{"type":"integer","enum":[0,1]},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date","default":null},"is_free":{"type":"integer","enum":[0,1]}}},"PaymentAccounts":{"type":"object","properties":{"type":{"type":"string","example":"clover"},"account_number":{"type":"string","example":"S2R8X3LEMKSMP"},"secret":{"type":"string","example":"cfbb00d2-6dfd-4de7-ac17-a29699cdba23"}}},"PaymentCards":{"type":"object","properties":{"token":{"type":"string","example":2537446225198291},"card_type":{"type":"string","example":"VISA"},"expiry_date":{"type":"string","example":1123},"save_card":{"type":"boolean","example":true}}},"CardCodes":{"type":"array","items":{"type":"string"},"example":["03E5F029348","04C4B910257","05A3D801166","53845123"]},"Setting":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":158},"group_id":{"type":"integer","format":"int64","example":201},"branch_id":{"type":"integer","format":"int64","default":null},"value":{"type":"string"},"data_type":{"type":"string","enum":["enum","boolean","string","number","array"]},"setting_type":{"type":"string"},"name":{"type":"string"}}},"Token":{"type":"object","properties":{"access_token":{"type":"string","example":"eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiIsImtpZCI6IjUxNzQzY2UzOWFjMzY4YWE2MTE2ZmI5MzJjMDRjYTI3In0.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNjc0ODQwMjU5fQ.2lkUbMDAdVxxgJe-F1Sr2sWRnXFM42MxPaeAY2UaoPEyK7r1sj0KcOT28Kl2g3tra2RQTLxkYv9xIrrgnAvzWA"},"refresh_token":{"type":"string","example":"36647f33-daa0-4e0b-9385-bc3ff2604447"}}},"Customer":{"type":"object","properties":{"status":{"type":"string","example":"enable"},"id":{"type":"integer","format":"int64","example":12345},"name":{"type":"string","example":"Thompson nobody"},"email":{"type":"string","example":"Thompson.nobody@facilipay.io"},"username":{"type":"string","example":72345678},"nickname":{"type":"string","example":"Maxwello"},"account_number":{"type":"string","example":2346754},"photo":{"type":"string","example":"https://www.gravatar.com/avatar/cdd094f4455ae329a9e5a4f17e58d813?s=200&d=retro"},"phone_number":{"type":"string","example":"+31613828447123"},"gender":{"type":"string","example":"female"},"language":{"type":"string","example":"en"},"date_birth":{"type":"string","example":"2020-02-22"},"age":{"type":"integer","format":"int64","example":4},"customer_since":{"type":"string","example":"2016-07-18"},"visits":{"type":"integer","format":"int64","example":22},"last_visit":{"type":"string","example":"2018-06-06"},"has_facebook":{"type":"boolean","example":false},"has_pin":{"type":"boolean","example":true},"card_codes":{"$ref":"#/components/schemas/CardCodes"},"payment_cards":{"type":"object","properties":{"card_type":{"type":"string","example":"mastercard"},"expiry_date":{"type":"string","example":1222},"save_card":{"type":"boolean","example":false}}},"modifiers":{"type":"object","properties":{"personal_reward":{"type":"integer","example":2},"credit_allowed":{"type":"boolean","example":true},"customer_note":{"type":"string","example":"test"},"role":{"type":"string","default":null}}},"loyalty":{"type":"object","properties":{"merchant_id":{"type":"integer","example":201},"expiry_days":{"type":"string","example":1222},"date_edit":{"type":"string","format":"date"}}},"balance":{"type":"object","properties":{"cash":{"type":"number","default":0,"example":0},"stamp":{"type":"integer","default":0,"example":0},"expiry_date":{"type":"string","default":""}}},"spending":{"type":"object","properties":{"credit":{"type":"object","properties":{"earned":{"type":"number","default":0,"example":22.02},"redeemed":{"type":"number","default":0,"example":22.02}}},"stamp":{"type":"object","properties":{"earned":{"type":"number","default":0,"example":22.02},"redeemed":{"type":"number","default":0,"example":22.02}}},"topups":{"type":"object","properties":{"gift":{"type":"number","default":0,"example":22.02},"cashless":{"type":"number","default":0,"example":22.02},"upfront":{"type":"number","default":0,"example":22.02}}},"stats":{"type":"object","properties":{"total":{"type":"number","default":0,"example":222.02},"trend":{"type":"number","default":0,"example":-2.16},"average":{"type":"number","default":0,"example":22.02}}}}}}},"Transactions":{"type":"object","properties":{"customer":{"type":"object","properties":{"id":{"type":"integer","example":12345},"name":{"type":"string","example":"Thompson"},"card_codes":{"$ref":"#/components/schemas/CardCodes"}}},"merchant":{"type":"object","properties":{"id":{"type":"integer","example":45},"name":{"type":"string","example":"Thompson Pizza"}}},"branch":{"type":"object","properties":{"id":{"type":"integer","example":275},"name":{"type":"string","example":"Retail Excellence"}}},"employee":{"type":"object","properties":{"id":{"type":"integer","example":275},"name":{"type":"string","example":"Thompson Nobody"}}},"payment_type":{"type":"string","example":"stamp"},"transaction_type":{"type":"string","example":"add"},"sale_total":{"type":"number","example":10},"amount":{"type":"number","example":1000},"rewards":{"type":"array","items":{"type":"string","example":"Free Lunch"},"default":[]},"refunded":{"type":"boolean","example":true},"voided":{"type":"boolean","example":false},"details":{"type":"object","properties":{"transaction":{"type":"object","properties":{"uid":{"type":"string","example":"f2t9lbbx8xhy5j3z | Transaction type: Redeem Gift | Amount: 672 | Insertion time: 1675088546761 | Order ID: 9HGJ7QXTYFWTK | Order Total: 0 | Order Access time: 0 | Customer balance: 106269 | Customer ID: 12345 | Employee: Lite - No employee | Email: thompson.nobody@facilipay.io | Note: Cashless, customer facing redeem"},"amount":{"type":"number","example":673},"insertion_time":{"type":"integer","example":1675088546761},"transaction_type":{"type":"string","example":"Redeem Gift"},"order_id":{"type":"string","example":"9HGJ7QXTYFWTK"},"order_access_time":{"type":"integer","default":0,"example":1674727178204},"order_total":{"type":"number","default":0,"example":600},"order_line_items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"MPE8YRKV2Y1K4"},"orderRef":{"type":"object","properties":{"id":{"type":"string","example":"9ZQS94C01F2HW"}}},"item":{"type":"object","properties":{"id":{"type":"string","example":"S7PB54A5345MP"}}},"createdTime":{"type":"integer","example":1674727152760},"orderClientCreatedTime":{"type":"integer","example":1674727152760},"binName":{"type":"string","default":null},"userData":{"type":"string","default":null},"itemCode":{"type":"string","default":""},"price":{"type":"number","example":500},"alternateName":{"type":"string","default":""},"name":{"type":"string","example":"Guinness"},"exchanged":{"type":"boolean","example":false},"refunded":{"type":"boolean","example":false},"printed":{"type":"boolean","example":false},"isRevenue":{"type":"boolean","example":true},"colorCode":{"type":"string","default":null},"note":{"type":"string","example":"- Validated - 966709463"},"modifications":{"type":"object","properties":{"elements":{"type":"array","items":{"type":"object","properties":{"modifier":{"type":"object","properties":{"id":{"type":"string","example":"EY6WH9Y973KJF"},"alternateName":{"type":"string","default":null},"name":{"type":"string","example":"Regular Fries & Regular Drink"},"price":{"type":"number","example":496}}},"amount":{"type":"number","example":456},"id":{"type":"string","example":"WC87GVZBKASQW"},"alternateName":{"type":"string","default":null},"name":{"type":"string","example":"Regular Fries & Regular Drink"}}}}}},"discounts":{"type":"object","properties":{"elements":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"DZX33WQT41YT5"},"amount":{"type":"number","example":3456},"name":{"type":"string","example":"LoyLap Redemption"}}}}}},"taxRates":{"type":"object","properties":{"elements":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"N16KQK514M2ZW"},"lineItemRef":{"type":"object","properties":{"id":{"type":"string","example":"SGGG8VWQ2SNN0"}}},"name":{"type":"string","example":"High Tax"},"rate":{"type":"integer","example":2000000},"taxAmount":{"type":"integer","example":0},"isDefault":{"type":"boolean","example":true},"taxType":{"type":"string","default":null}}}}}}}},"default":"None"},"customer_id":{"type":"string","example":"12345"},"customer_balance":{"type":"number","example":106269},"customer_personal_reward":{"type":"integer","example":-1},"cashback_rewards":{"type":"string","example":"N/A"},"note":{"type":"string","example":"Cashless, customer facing redeem"},"attempts":{"type":"integer","example":1}}},"device":{"type":"object","properties":{"employee":{"type":"string","example":"Lite - No employee"},"package":{"type":"string","example":"com.sp.vendor"},"version":{"type":"integer","example":820},"model":{"type":"string","example":"C503"},"serial":{"type":"string","example":"C053EQ92470015"}}}}},"unique_identifier":{"type":"string","example":"63d75c6ba9ca3 | Insertion time: 1677155435696 | Customer ID: 12345 | Amount: -10"},"account_id":{"type":"string","example":"12345"},"time":{"type":"string","format":"date-time","example":"2023-02-20T22:06:40.000Z"},"timestamp":{"type":"integer","example":1676930800}}},"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":3358},"name":{"type":"string","example":"John nobody"},"first_name":{"type":"string","example":"John"},"last_name":{"type":"string","example":"Nobody"},"email":{"type":"string","example":"john.nobody@facilipay.io"},"username":{"type":"string","example":"JohnNobody"},"account_number":{"type":"string","example":"84975104JNB"},"photo":{"type":"string"},"phone_number":{"type":"string"},"gender":{"type":"string","example":"male"},"language":{"type":"string","example":"en"},"date_birth":{"type":"string","format":"date"},"date_add":{"type":"integer","format":"int64","example":1407441047},"date_edit":{"type":"integer","format":"int64","example":1674681548},"last_group_id":{"type":"integer","format":"int64","example":217},"last_branch_id":{"type":"integer","format":"int64","example":361},"has_facebook":{"type":"boolean","example":false},"has_pin":{"type":"boolean","example":false},"card_codes":{"$ref":"#/components/schemas/CardCodes"},"payment_cards":{"$ref":"#/components/schemas/PaymentCards"},"status":{"type":"integer","example":1},"onboarding_type":{"type":"string"},"save_card":{"type":"boolean","example":true}},"xml":{"name":"User"}},"InventoryProduct":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryProducts"},"total":{"type":"number","example":1}}},"InventoryCategory":{"type":"object","properties":{"id":{"type":"number","format":"int64","example":217},"name":{"type":"string","example":"Beverages"},"description":{"type":"string","default":null,"example":"this is a description"},"created_at":{"type":"string","format":"date","example":"2022-04-04T12:31:56.000Z"},"updated_at":{"type":"string","format":"date","example":"2022-04-04T12:31:56.000Z"},"branch_id":{"type":"integer","format":"int64","default":null},"image":{"type":"string","default":null,"example":"image url"},"order":{"type":"number","format":"int64","example":2},"status":{"type":"boolean","example":true},"unavailable_for_order_ahead":{"type":"boolean","example":true},"unavailable_for_self_checkout":{"type":"boolean","example":true},"availability":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","example":"Sunday"},"from":{"type":"string","example":"00:00"},"to":{"type":"string","example":"23:59"},"isOpen":{"type":"boolean","example":true}}}},"products_total":{"type":"number","example":2}}},"InventoryCategoryProducts":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"inventory_products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number","format":"int64","example":217},"base_price":{"type":"number","format":"int64","example":290},"name":{"type":"string","example":"Guinness"},"unavailable_for_order_ahead":{"type":"boolean","example":true},"inventory_categories_products":{"type":"object","properties":{"category_id":{"type":"integer","format":"int64"},"id":{"type":"integer","format":"int64"},"product_id":{"type":"integer","format":"int64"},"unavailable_for_order_ahead":{"type":"boolean","example":true}}}}}}}},"InventoryModifiers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number","example":1},"name":{"type":"string","example":"PORTIONS"},"price":{"type":"number","example":9.99},"image":{"type":"string","default":null},"status":{"type":"string","enum":["0","1"]},"description":{"type":"string","default":null,"example":"this is a description"},"external_id":{"type":"string","example":"SDTX6S4750DZW"},"modifier_group_id":{"type":"number","example":1},"order":{"type":"number","example":4},"hidden":{"type":"boolean","example":false},"group_id":{"type":"number","example":108},"branch_id":{"type":"number","example":2534},"createdAt":{"type":"string","format":"date","example":"2022-04-04T12:31:56.000Z"},"updatedAt":{"type":"string","format":"date","example":"2022-04-04T12:31:56.000Z"}}}},"InventoryProducts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number","format":"int64","example":217},"external_id":{"type":"string","example":"SDTX6S4750DZW"},"external_code":{"type":"string","example":"SDTX6S4750DZW"},"name":{"type":"string","example":"Guinness"},"image":{"type":"string","default":null,"example":"https://ucarecdn.com/736337f8-91ad-420b-ab2a-a873da81c828/"},"base_price":{"type":"number","format":"int64","example":290},"branch_id":{"type":"number","example":2557},"description":{"type":"string","default":null,"example":"this is a description"},"created_at":{"type":"string","format":"date","example":"2022-04-04T12:31:56.000Z"},"updated_at":{"type":"string","format":"date","example":"2022-04-04T12:31:56.000Z"},"order":{"type":"number","format":"int64","example":2},"unavailable_for_order_ahead":{"type":"boolean","example":true},"unavailable_for_self_checkout":{"type":"boolean","example":true},"stamp_reward":{"type":"number","example":1},"reward":{"type":"string","default":null,"example":"this is a reward"},"price_type":{"type":"string","example":"FIXED"},"unit_name":{"type":"string","example":"weds"},"stock_count":{"type":"number","example":1},"limit_stock_value":{"type":"number","example":1},"limit_stock":{"type":"boolean","example":false},"collection":{"type":"boolean","example":true},"fixed_delivery":{"type":"boolean","example":false},"delivery":{"type":"boolean","example":true},"allergens":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number","example":1},"name":{"type":"string","example":"cereals containing gluten"}}}},"categories_ids":{"type":"array","items":{"type":"number","example":"172985, 172997"}},"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number","example":1},"name":{"type":"string","example":"Smaller Portions"},"image":{"type":"string","default":null}}}},"modifier_groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number","example":1},"name":{"type":"string","example":"PORTIONS"},"image":{"type":"string","default":null},"max_allowed":{"type":"number","example":3},"min_required":{"type":"number","example":3},"external_id":{"type":"string","example":"SDTX6S4750DZW"},"order":{"type":"number","example":1},"modifiers":{"$ref":"#/components/schemas/InventoryModifiers"},"tax_rates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number","example":49675214},"external_id":{"type":"string","example":"SDTX6S4750DZW"},"name":{"type":"string","example":"VAT"},"is_default":{"type":"string","enum":["0","1"]},"rate":{"type":"number","example":2300000}}}}}}}}}},"InventoryCategories":{"type":"array","items":{"$ref":"#/components/schemas/InventoryCategory"}},"InventoryModifierGroups":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number","format":"int64","example":217},"name":{"type":"string","example":"Add Toast & Jam"},"external_id":{"type":"string","example":"SDTX6S4750DZW"},"group_id":{"type":"number","example":108},"status":{"type":"string","enum":["0","1"]},"max_allowed":{"type":"number","example":3},"min_required":{"type":"number","example":3},"createdAt":{"type":"string","format":"date","example":"2022-04-04T12:31:56.000Z"},"updatedAt":{"type":"string","format":"date","example":"2022-04-04T12:31:56.000Z"},"modifiers":{"$ref":"#/components/schemas/InventoryModifiers"}}}},"total":{"type":"number","example":574}}},"InventoryModifierGroupsRequest":{"required":["name","branch_id"],"type":"object","properties":{"name":{"type":"string"},"branch_id":{"type":"integer","format":"int64","example":4219},"order":{"type":"number"},"max_allowed":{"type":"number","default":null},"min_required":{"type":"number","default":null},"modifiers":{"type":"array","items":{"type":"object","properties":{"external_id":{"type":"string","default":null},"hidden":{"type":"boolean"},"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"oder":{"type":"number"},"price":{"type":"number"},"status":{"type":"integer","enum":[0,1]}}}}}},"InventoryProductsSelection":{"type":"array","items":{"type":"object","properties":{"productId":{"type":"string","example":"701609"},"modifiersIdsExclusionList":{"type":"array","items":{"type":"string","example":["43321722","43321723"]}}}}},"InventoryCategoriesSelection":{"type":"array","items":{"type":"object","properties":{"categoryId":{"type":"string","example":"701609"},"productsIdsExclusionList":{"type":"array","items":{"type":"string","example":["43321722","43321723"]}}}}},"ProductCategoryAvailability":{"type":"object","properties":{"day":{"type":"string","example":"Friday"},"from":{"type":"string","example":"00:00"},"to":{"type":"string","example":"23:59"},"isOpen":{"type":"boolean"}}},"CreateUpdateProduct":{"type":"object","properties":{"branch_id":{"type":"integer","format":"int64","example":4219},"item_data":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"base_price":{"type":"number"},"categories_ids":{"type":"array","items":{"type":"number"}},"availability":{"type":"array","$ref":"#/components/schemas/ProductCategoryAvailability"},"allergens":{"type":"array","items":{"type":"number"}},"unavailable_for_order_ahead":{"type":"boolean"},"unavailable_for_self_checkout":{"type":"boolean"},"stamp_reward":{"type":"number","example":0},"reward":{"type":"number","example":1},"stock_count":{"type":"number","example":4},"limit_stock_value":{"type":"number","example":7},"limit_stock":{"type":"boolean"},"collection":{"type":"boolean"},"fixed_delivery":{"type":"boolean"},"delivery":{"type":"boolean"},"tax_rates":{"type":"array","$ref":"#/components/schemas/TaxRates"}}}}},"CreateUpdateCategory":{"type":"object","properties":{"branch_id":{"type":"integer","format":"int64","example":4219},"category_data":{"type":"object","properties":{"name":{"type":"string"},"order":{"type":"number","example":1},"availability":{"type":"array","default":null,"$ref":"#/components/schemas/ProductCategoryAvailability"},"unavailable_for_order_ahead":{"type":"boolean"},"unavailable_for_self_checkout":{"type":"boolean"}}}}},"TaxRates":{"type":"object","properties":{"external_id":{"type":"string","default":null},"id":{"type":"integer"},"is_default":{"type":"boolean"},"name":{"type":"string"},"rate":{"type":"number","example":2300000}}},"CampaignLimits":{"type":"object","properties":{"budget":{"type":"number"},"budget_email":{"type":"boolean"},"max_coupons":{"type":"number"},"max_coupons_email":{"type":"boolean"},"max_coupons_per_user":{"type":"number"},"max_coupons_per_user_period":{"type":"string","enum":["daily","weekly","fortnightly","monthly","yearly","all"]},"max_value_per_user":{"type":"number"},"max_value_per_user_period":{"type":"string","enum":["daily","weekly","fortnightly","monthly","yearly","all"]}}},"CampaignSchedules":{"type":"object","properties":{"custom_daily_period":{"type":"array","items":{"type":"string"}},"daily_period":{"type":"array","items":{"type":"string","enum":["morning","evening","night"]}},"days_of_week":{"type":"array","items":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]}},"period_date":{"type":"object","properties":{"start":{"type":"string","format":"date"},"end":{"type":"string","format":"date"}}}}},"AuthRefreshResponse":{"$ref":"#/components/schemas/Token"},"LoginResponse":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"merchant":{"$ref":"#/components/schemas/MerchantSummarized"},"tokens":{"$ref":"#/components/schemas/Token"}}},"PaymentResponse":{"type":"object","properties":{"error":{"type":"boolean","example":false},"message":{"type":"string","example":"Transaction Processed"},"group_id":{"description":"Facilipay id of the merchant that was debited or credited.","type":"integer","format":"int64","example":201}}},"MerchantResponse":{"type":"array","items":{"$ref":"#/components/schemas/Merchant"}},"MerchantOrdersResponse":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"uuid":{"type":"string"},"created_at":{"type":"string","format":"date"},"due_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date"},"type":{"type":"string","enum":["collection","delivery","fixed-delivery"]},"note":{"type":"string"},"delivery_address":{"type":"string"},"home_delivery_address":{"type":"string"},"status":{"type":"string","enum":["accepted","pending","preparing","ready","complete","declibed"]},"basket":{"type":"object","properties":{"id":{"type":"number"},"delivery_fee":{"type":"number"},"service_charge":{"type":"number"},"tax":{"type":"number"},"tip":{"type":"number"},"total":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"categories_ids":{"type":"array","items":{"type":"string"}},"details":{"type":"object","properties":{"category":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"price":{"type":"number"},"priceType":{"type":"string","enum":["FIXED","VARIABLE"]},"prirewardce":{"type":"number"},"stampReward":{"type":"number"},"taxRateValue":{"type":"number"},"totalPrice":{"type":"number"},"taxRates":{"type":"object","properties":{"elements":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"lineItemRef":{"type":"string"},"name":{"type":"string"},"rate":{"type":"number"},"value":{"type":"number"}}}}}},"modifiers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"price":{"type":"number"},"name":{"type":"string"}}}},"discounts":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"name":{"type":"string"}}}}}}}}}}},"branch":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"}}},"clover":{"type":"object","properties":{"order_id":{"type":"string"}}},"customer":{"type":"object","properties":{"email":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"phone":{"type":"string"}}},"merchant":{"type":"object","properties":{"id":{"type":"number"},"group_photo":{"type":"string"},"name":{"type":"string"}}}}}},"RegisterMerchantResponse":{"type":"object","properties":{"error":{"type":"string"},"user":{"$ref":"#/components/schemas/User"},"merchant":{"$ref":"#/components/schemas/MerchantSummarized"},"tokens":{"$ref":"#/components/schemas/Token"}}},"RegisterCardResponse":{"type":"object","properties":{"account_number":{"type":"string","example":84975104},"error":{"type":"boolean","example":false},"balance":{"$ref":"#/components/schemas/MemberBalance"},"cardStatus":{"type":"number","example":0},"details":{"$ref":"#/components/schemas/MemberDetails"},"historyOverview":{"$ref":"#/components/schemas/MemberHistoryOverview"}}},"InventoryProductsResponse":{"type":"object","properties":{"total":{"type":"number","example":282},"data":{"$ref":"#/components/schemas/InventoryProducts"}}},"InventoryProductsPostResponse":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string","example":"Product name"},"description":{"type":"string","example":"Product Description"},"base_price":{"type":"number","example":3333},"unavailable_for_order_ahead":{"type":"boolean"},"unavailable_for_self_checkout":{"type":"boolean"},"reward":{"type":"number","example":20},"stamp_reward":{"type":"number","example":0},"group_id":{"type":"string","example":"108"},"branch_id":{"type":"number","example":5309},"stock_count":{"type":"number","example":2},"status":{"type":"integer","enum":[0,1]},"updatedAt":{"type":"string","format":"date"},"createdAt":{"type":"string","format":"date"}}},"InventoryCategoriesResponse":{"type":"object","properties":{"total":{"type":"number","example":282},"data":{"$ref":"#/components/schemas/InventoryCategories"}}},"InventoryModifierGroupsResponse":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"max_allowed":{"type":"number"},"min_required":{"type":"number"},"order":{"type":"number"},"branch_id":{"type":"number"},"status":{"type":"integer","enum":[0,1]},"group_id":{"type":"string"},"updatedAt":{"type":"string"},"createdAt":{"type":"string","format":"date"}}},"InventoryModifierGroupResponse":{"type":"object","properties":{"branch_id":{"type":"number"},"updatedAt":{"type":"string","format":"date"},"createdAt":{"type":"string","format":"date"},"external_id":{"type":"string"},"group_id":{"type":"number"},"id":{"type":"number"},"image":{"type":"string"},"max_allowed":{"type":"string"},"min_required":{"type":"string"},"name":{"type":"string"},"order":{"type":"number"},"status":{"type":"string"},"modifiers":{"$ref":"#/components/schemas/InventoryModifiers"}}},"InventoryModifierGroupProductsResponse":{"type":"object","properties":{"branch_id":{"type":"number"},"group_id":{"type":"number"},"id":{"type":"number"},"name":{"type":"string"},"inventory_products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"base_price":{"type":"number"},"tax_included":{"type":"integer","enum":[0,1]},"image":{"type":"string"},"status":{"type":"string","enum":["0","1"]},"description":{"type":"string"},"price_type":{"type":"string"},"unit_name":{"type":"string"},"external_id":{"type":"string"},"external_code":{"type":"string"},"stock_count":{"type":"number"},"branch_id":{"type":"number"},"group_id":{"type":"number"},"order":{"type":"number"},"unavailable_for_order_ahead":{"type":"integer","enum":[0,1]},"unavailable_for_self_checkout":{"type":"integer","enum":[0,1]},"stamp_reward":{"type":"number"},"reward":{"type":"number"},"limit_stock_value":{"type":"number"},"limit_stock":{"type":"number"},"delivery":{"type":"integer","enum":[0,1]},"fixed_delivery":{"type":"integer","enum":[0,1]},"collection":{"type":"integer","enum":[0,1]},"createdAt":{"type":"string","format":"date"},"updatedAt":{"type":"string","format":"date"},"created_at":{"type":"string","format":"date"},"updated_at":{"type":"string","format":"date"},"inventory_modifiers_groups.inventory_products_modifiers_groups.id":{"type":"number"},"inventory_modifiers_groups.inventory_products_modifiers_groups.modifier_group_id":{"type":"number"},"inventory_modifiers_groups.inventory_products_modifiers_groups.product_id":{"type":"number"}}}}}},"ActivateAccountResponse":{"type":"object","properties":{"error":{"type":"boolean","example":false},"balance":{"$ref":"#/components/schemas/MemberBalance"},"cardStatus":{"type":"number","example":0},"details":{"$ref":"#/components/schemas/MemberDetails"},"historyOverview":{"$ref":"#/components/schemas/MemberHistoryOverview"},"history":{"type":"object","properties":{"id_customer":{"type":"number","example":23456789},"id_business":{"type":"number","example":2345},"amount":{"type":"number","example":2345},"time":{"type":"string","format":"date-time","example":"2023-02-20T22:06:40.000Z"},"timestamp":{"type":"integer","example":1676930800},"transaction_type":{"type":"string","example":"add"},"id_group":{"type":"number","example":176},"group_name":{"type":"string","example":"Pals Pizza"},"loyaltyType":{"type":"string","example":"gift"},"short_name":{"type":"string","example":"Pals Pizza"},"branch_name":{"type":"string","example":"Branch name"},"unique_identifier":{"type":"string","example":"645e464ba7cc1 | Insertion time: 16838999796 | Customer ID: 554046543 | Amount: 200"}}}}},"MemberBalance":{"type":"object","properties":{"id":{"type":"number"},"cash_balance":{"type":"string","format":"decimal","example":"25.50","description":"Spendable stored-value balance (gift card, prepaid and cashless credit combined) in major units, as a decimal string; \"25.50\" is €25.50."},"stamp_balance":{"type":"number","default":0},"date_edit":{"type":"number","description":"Unix Timestamp"},"customer_note":{"type":"string"},"credit_allowed":{"type":"number"},"personal_reward":{"type":"number"},"surcharge":{"type":"number"},"auto_topup":{"type":"number"},"role":{"type":"string"}}},"MemberDetails":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":3358},"first_name":{"type":"string","example":"John"},"last_name":{"type":"string","example":"Nobody"},"nickname":{"type":"string"},"photo":{"type":"string","example":"https://www.gravatar.com/avatar/1fbb84bc9211d3f42c08b9f7bf007572?s=200&d=retro"},"email":{"type":"string","example":"john.nobody@facilipay.io"},"phone_number":{"type":"string"},"username":{"type":"string","example":"JohnNobody"},"account_number":{"type":"string","example":"84975104JNB"},"account_id":{"type":"string","example":"84975104JNB"},"cvv":{"type":"string","example":123},"card_codes":{"type":"string","example":"84975104JNB"},"status":{"type":"number","example":2},"date_register":{"type":"number","example":1683818618,"description":"Unix Timestamp"},"date_birth":{"type":"string","format":"date","example":"1999-05-10T00:00:00.000Z"},"activation_code":{"type":"string"},"new_password":{"type":"string","example":1},"new_password_code":{"type":"string"},"fb_id":{"type":"string"},"popdeem_rewards":{"type":"number","example":0},"payeezy_token":{"type":"string"},"expiry_date":{"type":"string","example":1225},"card_type":{"type":"string","example":"visa debit"},"scheme_transaction_id":{"type":"string"},"save_payment_details":{"type":"string"},"stripe_user_token":{"type":"string"},"stripe_customer_id":{"type":"string"},"stripe_subscription_id":{"type":"string"},"gocardless_customer_id":{"type":"string"},"gocardless_mandate_id":{"type":"string"},"gocardless_subscription_id":{"type":"string"},"date_add":{"type":"number","example":1683818618,"description":"Unix Timestamp"},"device_token":{"type":"string"},"gcm_id":{"type":"string"},"apn_id":{"type":"string"},"gender":{"type":"integer","example":1},"last_group_id":{"type":"integer","format":"int64","example":217},"last_branch_id":{"type":"integer","format":"int64","example":316},"employee":{"type":"integer","example":1},"owner":{"type":"integer","example":0},"lang":{"type":"string","example":"en"}}},"MemberHistoryOverview":{"type":"object","properties":{"total_visits":{"type":"number","example":0},"period_visits":{"type":"number","example":0},"period":{"type":"number","example":730},"total_spend":{"type":"string","example":"Not applicable"},"period_spend":{"type":"string","example":"Not applicable"},"silver_reward":{"type":"string","example":"free reward"},"gold_reward":{"type":"number"},"platinum_reward":{"type":"number"},"number_redeems":{"type":"number","example":0},"amount_redeems":{"type":"string","example":"Not applicable"},"monthly_visits":{"type":"number","example":0},"monthly_spend":{"type":"string","example":"Not applicable"},"monthly_rank":{"type":"number","example":0},"reward_tier_1":{"type":"number","example":10},"reward_tier_2":{"type":"number","example":0},"reward_tier_3":{"type":"number","example":0},"reward_tier_4":{"type":"number","example":0}}},"RegisterMemberResponse":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"tokens":{"$ref":"#/components/schemas/Token"}}},"MemberResponse":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"campaigns":{"$ref":"#/components/schemas/Campaigns"},"balance":{"$ref":"#/components/schemas/Balance"}}},"ListCustomersResponse":{"type":"object","properties":{"total":{"type":"integer","example":43590},"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}}}},"ListTransactionsResponse":{"type":"object","properties":{"total":{"type":"integer","example":76854},"data":{"type":"array","items":{"$ref":"#/components/schemas/Transactions"}}}},"MerchantCustomerAccountResponse":{"type":"object","properties":{"error":{"type":"boolean","default":false},"balance":{"allOf":[{"$ref":"#/components/schemas/MemberBalance"},{"type":"object","properties":{"tiers":{"type":"object","properties":{"customer_levels":{"type":"integer","example":3},"user_tier":{"type":"integer","example":1}}}}}]},"cardStatus":{"type":"integer","enum":[0,1]},"details":{"$ref":"#/components/schemas/MemberDetails"},"campaigns":{"type":"object","properties":{"error":{"type":"string"}}}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}},"AmountBreakdown":{"type":"object","description":"Detailed breakdown of transaction amount components. All amounts in smallest currency unit (e.g. cents). Only fields supported by the gateway are populated.","required":["totalAmount"],"properties":{"totalAmount":{"type":"integer","description":"Total transaction amount in cents","example":1350},"tipAmount":{"type":"integer","description":"Tip amount in cents (if provided by gateway)","nullable":true,"example":200},"taxAmount":{"type":"integer","description":"Tax amount in cents (if provided by gateway)","nullable":true,"example":100},"cashbackAmount":{"type":"integer","description":"Cashback amount in cents (if provided by gateway)","nullable":true,"example":0},"surchargeAmount":{"type":"integer","description":"Surcharge fee in cents (if provided by gateway)","nullable":true,"example":50},"convenienceFeeAmount":{"type":"integer","description":"Convenience fee in cents (if provided by gateway)","nullable":true,"example":0},"dualPricingAmount":{"type":"integer","description":"Dual pricing amount in cents (if provided by gateway)","nullable":true,"example":0}}},"GatewayTransaction":{"type":"object","description":"Normalized transaction from a payment gateway","properties":{"transactionId":{"type":"string","description":"Unique transaction ID from the gateway","example":"TXN-2026-001234"},"orderId":{"type":"string","description":"Gateway-specific order/reference ID","example":"ORD-5678"},"terminalId":{"type":"string","description":"Terminal ID that processed the transaction","example":"TERM001"},"merchantId":{"type":"string","description":"Merchant ID","example":"253"},"gateway":{"type":"string","description":"Payment provider identifier assigned by Facilipay; `stored_value` for Facilipay stored-value rows"},"platformName":{"type":"string","description":"Terminal platform name from the merchant's configuration"},"transactionType":{"type":"string","description":"Transaction type","enum":["SALE","REFUND","VOID","PREAUTH","CAPTURE","OFFLINE"],"example":"SALE"},"amount":{"$ref":"#/components/schemas/AmountBreakdown"},"currency":{"type":"string","description":"Currency code (ISO 4217)","example":"EUR"},"cardBrand":{"type":"string","description":"Card brand","enum":["VISA","MASTERCARD","AMEX","DISCOVER","DINERS","JCB","UNIONPAY","FACILIPAY","UNKNOWN"],"example":"VISA"},"cardLast4":{"type":"string","description":"Last 4 digits of card","example":"1234"},"entryMode":{"type":"string","description":"Card entry mode. Not provided by the payment gateway's transaction listing; returned empty","example":""},"status":{"type":"string","description":"Payment gateway status, passed through untouched (for example READY or VOID). A voided sale keeps transactionType SALE and reports VOID here","example":"READY"},"authCode":{"type":"string","description":"Authorization code. Not provided by the payment gateway's transaction listing; returned empty","example":""},"transactionDate":{"type":"string","format":"date-time","description":"Gateway processing timestamp, not the settlement time. No batch reference or settlement date is available on a transaction","example":"2026-01-15T14:30:00Z"}}},"TransactionReportResponse":{"type":"object","description":"Transaction report response with flattened pagination","properties":{"generatedAt":{"type":"string","format":"date-time","description":"Report generation timestamp","example":"2026-01-20T10:00:00Z"},"data":{"type":"array","description":"Transactions matching the provided filters","items":{"$ref":"#/components/schemas/GatewayTransaction"}},"total":{"type":"integer","description":"Total number of results available","example":150},"totalPages":{"type":"integer","description":"Total number of pages","example":3},"currentPage":{"type":"integer","description":"Current page number (1-based)","example":1},"perPage":{"type":"integer","description":"Results per page","example":50},"truncated":{"type":"boolean","description":"True when the gateway stopped returning pages before the window was fully read (page cap or a cursor that stopped advancing). Rows may then be missing and `total` may be low; narrow the date range and retry.","example":false}}},"StoredValueTransaction":{"type":"object","description":"Stored value transaction (gift card, prepaid, cashless wallet)","properties":{"transactionId":{"type":"string","description":"Unique transaction identifier","example":"SV-001234"},"orderId":{"type":"string","description":"Associated order ID parsed from unique_identifier where available","nullable":true,"example":"ORD-5678"},"loyaltyType":{"type":"string","description":"Stored value type","enum":["gift","upfront","cashless","refund"],"example":"gift"},"terminalId":{"type":"string","description":"Terminal identifier from customer transactions","example":"TERM001"},"cardBrand":{"type":"string","description":"Payment brand for reporting harmonization","enum":["VISA","MASTERCARD","AMEX","DISCOVER","DINERS","JCB","UNIONPAY","FACILIPAY","UNKNOWN"],"example":"UNKNOWN"},"amount":{"type":"object","description":"Stored value amount payload currently returns totalAmount only","required":["totalAmount"],"properties":{"totalAmount":{"type":"integer","description":"Total transaction amount in cents","example":500}}},"balanceAfter":{"type":"integer","description":"Balance after transaction in cents","example":1500},"transactionDate":{"type":"string","format":"date-time","description":"Transaction timestamp","example":"2026-01-15T14:35:00Z"},"merchantId":{"type":"string","description":"Merchant ID","example":"253"}}},"GatewayBatch":{"type":"object","description":"Normalized batch from a payment gateway","properties":{"batchId":{"type":"string","description":"Batch ID, the gateway's unique reference for the batch","example":"BATCH-001"},"batchNumber":{"type":"string","description":"The gateway's sequential batch number for the terminal, as printed on the terminal's settlement report. Absent on synthetic Facilipay batches","example":"93"},"terminalId":{"type":"string","description":"Terminal ID","example":"TERM001"},"merchantId":{"type":"string","description":"Merchant ID","example":"253"},"gateway":{"type":"string","description":"Payment provider identifier assigned by Facilipay"},"platformName":{"type":"string","description":"Terminal platform name from the merchant's configuration; `Facilipay` for synthetic stored-value batches"},"status":{"type":"string","description":"Batch status. `IN_PROGRESS` is a gateway batch that has been submitted for settlement but has not completed; it has no `closedAt` yet. Synthetic Facilipay stored-value batches are never `IN_PROGRESS`.","enum":["OPEN","CLOSED","IN_PROGRESS"],"example":"CLOSED"},"openedAt":{"type":"string","format":"date-time","description":"When the terminal closed and submitted the batch (Worldnet dateTime). Not an open time: every transaction in the batch is dated at or before it. In-progress batches are selected and sorted by this value. A batch for which the gateway reported no such time carries 1970-01-01T00:00:00Z here. On a synthetic Facilipay stored-value batch this is the report's startDate, not a gateway event. Only a legacy-shape batch that reports an open time and no close time carries that open time here instead.","example":"2026-01-15T06:00:00Z"},"closedAt":{"type":"string","format":"date-time","description":"Settlement completion time. Batches are selected by this value when present (both window bounds inclusive), otherwise by openedAt. Absent while the batch is IN_PROGRESS. On a synthetic Facilipay stored-value batch this is the report's endDate, not a gateway event.","nullable":true,"example":"2026-01-15T22:00:00Z"},"transactionCount":{"type":"integer","description":"Number of transactions in batch","example":45},"salesTotal":{"type":"integer","description":"Settled sales amount in cents, inclusive of tips. Voided sales are not included","example":125000},"salesCount":{"type":"integer","description":"Number of sales","example":40},"refundsTotal":{"type":"integer","description":"Total refunds amount in cents","example":5000},"refundsCount":{"type":"integer","description":"Number of refunds","example":5},"voidsTotal":{"type":"integer","description":"Total voided amount in batch (cents). Informational; voided sales are already excluded from salesTotal and netAmount","example":2000},"voidsCount":{"type":"integer","description":"Number of voids","example":2},"declinesTotal":{"type":"integer","description":"Gross declined amount in batch (cents, base + tip combined). These transactions never settled.","example":3000},"declinesCount":{"type":"integer","description":"Number of declined transactions","example":3},"tipsTotal":{"type":"integer","description":"Total tip amount in batch (cents)","example":500},"netAmount":{"type":"integer","description":"Net settled amount in cents, inclusive of tips. The gateway's own figure; equals salesTotal − refundsTotal (voided sales are already excluded from salesTotal)","example":120000},"transactions":{"type":"array","description":"Transactions in this batch. Present only when `includeTransactions` is true, and then complete for the batch (the gateway is paged until exhausted). Batch totals do not depend on this array.","items":{"$ref":"#/components/schemas/GatewayTransaction"}},"storedValueTransactions":{"type":"array","description":"Stored value transactions during this batch period. Governed by `includeLoyalty`, not `includeTransactions`.","nullable":true,"items":{"$ref":"#/components/schemas/StoredValueTransaction"}},"cardTypeSummary":{"type":"array","description":"Per-card-type breakdown of settled totals. Present when the gateway provides summary data.","nullable":true,"items":{"$ref":"#/components/schemas/BatchCardTypeSummary"}}}},"BatchCardTypeSummary":{"type":"object","description":"Per-card-type breakdown within a batch. All monetary values in smallest currency unit (e.g. cents).","properties":{"cardType":{"type":"string","description":"Card type label as provided by the gateway (e.g. \"Visa Debit\", \"MasterCard\")","example":"Visa Debit"},"currency":{"type":"string","description":"ISO 4217 currency code","example":"EUR"},"netAmount":{"type":"integer","description":"Net settled amount in cents, inclusive of tips. The gateway's own figure; equals salesTotal − refundsTotal (voided sales are already excluded from salesTotal)","example":50000},"tipsTotal":{"type":"integer","description":"Settled tip component within netAmount in cents. netAmount - tipsTotal = base net.","example":500},"salesTotal":{"type":"integer","description":"Settled sales amount in cents, inclusive of tips. Voided sales are not included","example":55000},"salesCount":{"type":"integer","description":"Number of settled sales","example":20},"refundsTotal":{"type":"integer","description":"Total refunded amount in cents","example":3000},"refundsCount":{"type":"integer","description":"Number of refunds","example":2},"voidsTotal":{"type":"integer","description":"Total voided amount in cents. Informational; voided sales are already excluded from salesTotal and netAmount","example":2000},"voidsCount":{"type":"integer","description":"Number of voids","example":1},"declinesTotal":{"type":"integer","description":"Gross declined amount in cents (base + tip combined). Never settled — excluded from netAmount.","example":1000},"declinesCount":{"type":"integer","description":"Number of declined transactions","example":1},"transactionCount":{"type":"integer","description":"Total transaction count (sales + refunds + voids + declines)","example":24}}},"BatchReportSummary":{"type":"object","description":"Summary totals over the whole filtered set (all pages). Every gateway figure is a sum of the gateway's own batch-level totals, never of the transactions arrays.","properties":{"batchCount":{"type":"integer","description":"Total number of batches across all pages, including synthetic Facilipay batches","example":5},"gatewayTransactionCount":{"type":"integer","description":"Total gateway transactions (sales + refunds + voids + declines)","example":225},"gatewaySalesTotal":{"type":"integer","description":"Total gateway sales in cents, inclusive of tips. Voided sales are not included","example":625000},"gatewayTipsTotal":{"type":"integer","description":"Total gateway tips from batch-level gateway totals in cents","example":5000},"gatewayRefundsTotal":{"type":"integer","description":"Total gateway refunds in cents","example":25000},"gatewayVoidsTotal":{"type":"integer","description":"Total gateway voids in cents","example":10000},"gatewayVoidsCount":{"type":"integer","description":"Number of gateway voids","example":4},"gatewayNetAmount":{"type":"integer","description":"Sum of each batch's gateway-reported netAmount, in cents. Equals gatewaySalesTotal − gatewayRefundsTotal; voids are not subtracted because they are already excluded from sales","example":600000},"gatewayAmexSalesTotal":{"type":"integer","description":"Summed salesTotal in cents of the batches classified as AMEX by their first transaction. Zero when includeAmex is false.","example":125000},"gatewayAmexTipsTotal":{"type":"integer","description":"Summed tipsTotal in cents of the AMEX batches. Zero when includeAmex is false.","example":1000},"gatewayAmexRefundsTotal":{"type":"integer","description":"Summed refundsTotal in cents of the AMEX batches. Zero when includeAmex is false.","example":5000},"gatewayAmexVoidsTotal":{"type":"integer","description":"Summed voidsTotal in cents of the AMEX batches. Zero when includeAmex is false.","example":2000},"gatewayAmexNetAmount":{"type":"integer","description":"Summed netAmount in cents of the AMEX batches. The non-AMEX settlement is gatewayNetAmount − gatewayAmexNetAmount. Zero when includeAmex is false.","example":120000},"storedValueRedemptionCount":{"type":"integer","description":"Total stored value redemptions","example":30},"storedValueRedemptionTotal":{"type":"integer","description":"Total stored value redemption amount in cents","example":15000},"netSalesTotal":{"type":"integer","description":"Combined net sales (gatewayNetAmount + storedValueRedemptionTotal) in cents","example":615000}}},"BatchReportResponse":{"type":"object","description":"Batch report response with flattened pagination","properties":{"generatedAt":{"type":"string","format":"date-time","description":"Report generation timestamp","example":"2026-01-20T10:00:00Z"},"startDate":{"type":"string","format":"date-time","description":"Report date range start","example":"2026-01-01T00:00:00Z"},"endDate":{"type":"string","format":"date-time","description":"Report date range end","example":"2026-01-31T23:59:59Z"},"merchantId":{"type":"string","description":"Merchant ID","example":"253"},"batches":{"type":"array","description":"The current page of batches, newest first by reference time (closedAt when present, otherwise openedAt)","items":{"$ref":"#/components/schemas/GatewayBatch"}},"summary":{"$ref":"#/components/schemas/BatchReportSummary"},"total":{"type":"integer","description":"Total number of batches matching the filters, across all pages","example":150},"totalPages":{"type":"integer","description":"Total number of pages","example":3},"currentPage":{"type":"integer","description":"Current page number (1-based)","example":1},"perPage":{"type":"integer","description":"Batches per page","example":50},"truncated":{"type":"boolean","description":"True when the gateway's batch listing, or the transaction fetch for a batch on this page, stopped before being fully read (page cap or a cursor that stopped advancing). Batches, `summary` and `total` may then be incomplete; narrow the date range and retry.","example":false}}}},"securitySchemes":{"authorization":{"type":"apiKey","name":"authorization","description":"JWT to authorize requests.","in":"header"},"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"}}}}