### Request Headers Example (ISO 8601 Timestamps) Source: https://docs.uds.app/index This snippet demonstrates the required headers for making requests to the Partner API. It includes an example of an X-Origin-Request-Id (UUID) and an X-Timestamp in ISO 8601 format. ```text X-Origin-request-Id: 8c828ee7-e7b2-4631-a3e4-b18987962556 X-Timestamp: 2016-07-08T13:17:39,245+00:00 ``` -------------------------------- ### Change UDS Order API Request Examples Source: https://docs.uds.app/index Examples of how to change an order using the UDS App API, including a JSON payload and curl command. ```json { "deliveryCase": { "name": "zone A", "value": 0.1 }, "items": [ { "id": 0, "variantName": "string", "qty": 0 } ] } ``` ```curl curl -X PUT \ https://api.uds.app/partner/v2/goods-orders/{id} \ -H 'Authorization: Basic ' \ -H 'Content-Type: application/json' \ -d '{ "deliveryCase": { "name": "zone A", "value": 0.1 }, "items": [ { "id": 0, "variantName": "string", "qty": 0 } ] }' ``` ```php "https://api.uds.app/partner/v2/goods-orders/{id}", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "PUT", CURLOPT_HTTPHEADER => [ "Authorization: Basic ", "Content-Type: application/json" ], CURLOPT_POSTFIELDS => "{ \"deliveryCase\": { \"name\": \"zone A\", \"value\": 0.1 }, \"items\": [ { \"id\": 0, \"variantName\": \"string\", \"qty\": 0 } ] }" ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:". $err; } else { echo $response; } ``` ```python import requests url = "https://api.uds.app/partner/v2/goods-orders/{id}" payload = { "deliveryCase": { "name": "zone A", "value": 0.1 }, "items": [ { "id": 0, "variantName": "string", "qty": 0 } ] } headers = { 'Authorization': 'Basic ', 'Content-Type': 'application/json' } response = requests.request("PUT", url, headers=headers, json=payload) print(response.text) ``` ```node var request = require('request'); var options = { 'method': 'PUT', 'url': 'https://api.uds.app/partner/v2/goods-orders/{id}', 'headers': { 'Authorization': 'Basic ', 'Content-Type': 'application/json' }, body: JSON.stringify({ "deliveryCase": { "name": "zone A", "value": 0.1 }, "items": [ { "id": 0, "variantName": "string", "qty": 0 } ] }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); ``` -------------------------------- ### Get Operation Request Sample (Python) Source: https://docs.uds.app/index Python script to fetch transaction details using the 'requests' library. It constructs the API URL, sets authentication, and sends a GET request, handling potential errors. ```python import requests import uuid import datetime def get_operation(op_id, company_id, api_key): url = f"https://api.uds.app/partner/v2/operations/{op_id}" headers = { 'Accept': 'application/json', 'X-Origin-Request-Id': str(uuid.uuid4()), 'X-Timestamp': datetime.datetime.now(datetime.timezone.utc).isoformat(timespec='seconds').replace('+00:00', 'Z') } try: response = requests.get(url, headers=headers, auth=(company_id, api_key)) response.raise_for_status() # Raise an exception for bad status codes return response.json() except requests.exceptions.RequestException as e: print(f"Error fetching operation: {e}") return None # Example usage: # op_id = '123' # company_id = 'YOUR_COMPANY_ID' # api_key = 'YOUR_API_KEY' # operation_data = get_operation(op_id, company_id, api_key) # if operation_data: # print(operation_data) ``` -------------------------------- ### Get Operation Request Sample (cURL) Source: https://docs.uds.app/index This cURL command demonstrates how to retrieve transaction information using the GET method on the /operations/{id} endpoint. It includes necessary headers for authorization and request identification. ```curl curl -H 'Accept: application/json' \ -H "X-Origin-Request-Id: $(uuidgen)" \ -H "X-Timestamp: $(date --iso-8601=seconds --utc)" \ -u ":" \ -X GET -s https://api.uds.app/partner/v2/operations/ ``` -------------------------------- ### Get Operation Request Sample (Node.js) Source: https://docs.uds.app/index Example of fetching transaction details using Node.js. This code snippet utilizes the 'axios' library to make a GET request to the UDS API, including authentication headers. ```javascript const axios = require('axios'); async function getOperation(id, companyId, apiKey) { try { const response = await axios.get(`https://api.uds.app/partner/v2/operations/${id}`, { headers: { 'Accept': 'application/json', 'X-Origin-Request-Id': require('uuid').v4(), 'X-Timestamp': new Date().toISOString().replace(/\.\d+Z$/, 'Z'), }, auth: { username: companyId, password: apiKey } }); return response.data; } catch (error) { console.error('Error fetching operation:', error); throw error; } } // Example usage: // getOperation('123', 'YOUR_COMPANY_ID', 'YOUR_API_KEY'); ``` -------------------------------- ### GET /settings Source: https://docs.uds.app/index Retrieves company settings, including marketing configurations and invitation promo codes. ```APIDOC ## GET /settings ### Description Acquires company settings, including marketing configurations and promo codes for invitations. Marketing settings can be managed within UDS Business. ### Method GET ### Endpoint `/partner/v2/settings` ### Parameters #### Path Parameters None #### Query Parameters None #### Header Parameters - **X-Origin-Request-Id** (string) - Required - Query identifier (UUID). - **X-Timestamp** (string) - Required - Timestamp in ISO8601 date format. ### Request Example ```bash curl -H 'Accept: application/json' \ -H "X-Origin-Request-Id: $(uuidgen)" \ -H "X-Timestamp: $(date --iso-8601=seconds --utc)" \ -u ":" \ -X GET -s https://api.uds.app/partner/v2/settings ``` ### Response #### Success Response (200) - **settings** (object) - Contains various company and marketing settings. #### Response Example ```json { "settings": { "companyName": "Example Corp", "marketingPolicy": { "discountLimit": 5000 }, "promoCode": "WELCOME10" } } ``` ``` -------------------------------- ### Create Voucher Request Samples Source: https://docs.uds.app/index Samples for creating a voucher, including JSON payload and examples in cURL, PHP, Python, and Node.js. These samples demonstrate the structure required for the request body. ```json { "nonce": "string", "cashier": { "externalId": "string", "name": "string" }, "receipt": { "total": 0, "number": "string", "skipLoyaltyTotal": 0 } } ``` ```curl curl -X POST https://api.uds.app/partner/v2/operations/voucher \ -H "Content-Type: application/json" \ -d '{ "nonce": "string", "cashier": { "externalId": "string", "name": "string" }, "receipt": { "total": 0, "number": "string", "skipLoyaltyTotal": 0 } }' ``` ```php 'string', 'cashier' => [ 'externalId' => 'string', 'name' => 'string' ], 'receipt' => [ 'total' => 0, 'number' => 'string', 'skipLoyaltyTotal' => 0 ] ]; $options = [ 'http' => [ 'method' => 'POST', 'header' => "Content-type: application/json\r\n", 'content' => json_encode($data) ] ]; $context = stream_context_create($options); $result = file_get_contents('https://api.uds.app/partner/v2/operations/voucher', false, $context); var_dump($result); ?> ``` ```python import requests import json data = { "nonce": "string", "cashier": { "externalId": "string", "name": "string" }, "receipt": { "total": 0, "number": "string", "skipLoyaltyTotal": 0 } } response = requests.post('https://api.uds.app/partner/v2/operations/voucher', json=data) print(response.json()) ``` ```node const https = require('https'); const data = JSON.stringify({ nonce: 'string', cashier: { externalId: 'string', name: 'string' }, receipt: { total: 0, number: 'string', skipLoyaltyTotal: 0 } }); const options = { hostname: 'api.uds.app', port: 443, path: '/partner/v2/operations/voucher', method: 'POST', headers: { 'Content-Type': 'application/json', 'Content-Length': data.length } }; const req = https.request(options, (res) => { let responseBody = ''; res.on('data', (chunk) => { responseBody += chunk; }); res.on('end', () => { console.log(JSON.parse(responseBody)); }); }); req.on('error', (error) => { console.error(error); }); req.write(data); req.end(); ``` -------------------------------- ### Create Item/Category - Node.js Request Source: https://docs.uds.app/index Illustrates how to create an item or category using Node.js. This example demonstrates making a POST request with appropriate headers and JSON body. ```javascript const fetch = require('node-fetch'); const companyId = ''; const apiKey = ''; const url = 'https://api.uds.app/partner/v2/goods'; const headers = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization': `Basic ${Buffer.from(`${companyId}:${apiKey}`).toString('base64')}` }; const payload = { 'name': 'string', 'nodeId': 0, 'externalId': 'string', 'data': { 'type': 'CATEGORY' }, 'hidden': true }; fetch(url, { method: 'POST', headers: headers, body: JSON.stringify(payload) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Get Goods List (cURL) Source: https://docs.uds.app/index This cURL command demonstrates how to retrieve a list of goods or categories from the UDS API. It shows examples for fetching items from the top level and filtering by category ID. Authentication is handled via basic authentication with company ID and API key. ```bash // Get price list starting from the top item curl -H 'Accept: application/json' \ -H "X-Origin-Request-Id: $(uuidgen)" \ -H "X-Timestamp: $(date --iso-8601=seconds --utc)" \ -u ":" -X GET -s https://api.uds.app/partner/v2/goods?max=10&offset=0 // Get price list items of the category with id=132 curl -H 'Accept: application/json' \ -H "X-Origin-Request-Id: $(uuidgen)" \ -H "X-Timestamp: $(date --iso-8601=seconds --utc)" \ -u ":" -X GET -s https://api.uds.app/partner/v2/goods?max=10&offset=0&nodeId=123 ``` -------------------------------- ### GET /partner/v2/operations Source: https://docs.uds.app/index Fetches a list of company transactions. Supports pagination and filtering. ```APIDOC ## List of transactions Fetches list of company transactions. ### Method GET ### Endpoint https://api.uds.app/partner/v2/operations ### Query Parameters - **max** (integer) - Optional - Limits the number of results in the response. Maximum value is 50. - **offset** (integer) - Deprecated - Used to paginate results by a given offset. Maximum value is 10000. - **cursor** (string) - Optional - Used to paginate results by a cursor. ### Responses #### Success Response (200) - **rows** (array) - Contains a list of transaction objects. - **id** (integer) - The unique identifier of the transaction. - **dateCreated** (string) - The date and time the transaction was created (ISO 8601 format). - **action** (string) - The type of action performed (e.g., "PURCHASE"). - **state** (string) - The state of the transaction (e.g., "NORMAL"). - **customer** (object) - Information about the customer involved in the transaction. - **id** (integer) - The customer's unique identifier. - **displayName** (string) - The customer's display name. - **uid** (string) - The customer's unique ID. - **membershipTier** (object) - Details about the customer's membership tier. - **uid** (string) - The membership tier's unique identifier. - **name** (string) - The name of the membership tier. - **rate** (number) - The rate associated with the membership tier. - **maxScoresDiscount** (number) - The maximum discount that can be applied using scores. - **conditions** (object) - Conditions for the membership tier. - **totalCashSpent** (object) - Condition based on total cash spent. - **target** (number) - The target amount for total cash spent. - **effectiveInvitedCount** (object) - Condition based on effective invited count. - **target** (number) - The target number of effective invited users. - **cashier** (object) - Information about the cashier who processed the transaction. - **id** (integer) - The cashier's unique identifier. - **displayName** (string) - The cashier's display name. - **branch** (object) - Information about the branch where the transaction occurred. - **id** (integer) - The branch's unique identifier. - **displayName** (string) - The branch's display name. - **points** (integer) - Points awarded or redeemed in the transaction. - **certificatePoints** (integer) - Points related to certificates. - **receiptNumber** (string) - The receipt number for the transaction. - **origin** (object) - Information about the transaction's origin. - **id** (integer) - The origin's unique identifier. - **total** (integer) - The total amount of the transaction. - **cursor** (string) - A cursor for paginating to the next set of results. #### Request Example ```bash curl -H 'Accept: application/json' \ -H "X-Origin-Request-Id: $(uuidgen)" \ -H "X-Timestamp: $(date --iso-8601=seconds --utc)" \ -u ":" \ -X GET -s https://api.uds.app/partner/v2/operations?max=10 ``` #### Response Example (200) ```json { "rows": [ { "id": 0, "dateCreated": "2025-11-13T08:09:19Z", "action": "PURCHASE", "state": "NORMAL", "customer": { "id": 0, "displayName": "string", "uid": null, "membershipTier": { "uid": "string", "name": "string", "rate": 0, "maxScoresDiscount": 0, "conditions": { "totalCashSpent": { "target": 0 }, "effectiveInvitedCount": { "target": 0 } } } }, "cashier": { "id": 0, "displayName": "string" }, "branch": { "id": 0, "displayName": "string" }, "points": 0, "certificatePoints": 0, "receiptNumber": "string", "origin": { "id": 0 } } ], "total": 0, "cursor": "string" } ``` ``` -------------------------------- ### New Customer Webhook Request Sample (JSON) Source: https://docs.uds.app/index Example JSON payload for a 'New Customer' webhook notification. This schema details customer information such as ID, inviter ID, points, discount rates, spending, referral counts, and membership tier details. It's sent to a configured external webhook. ```json { "id": 0, "inviterId": 0, "points": 0, "discountRate": 0, "cashbackRate": 0, "cashSpent": 0, "savedFunds": 0, "invitedCount": 0, "effectiveInvitedCount": 0, "operationsCount": 0, "fullRefundsCount": 0, "note": "string", "membershipTier": { "name": "string", "rate": 0, "maxScoresDiscount": 0, "conditions": { "totalCashSpent": { "target": 0 }, "effectiveInvitedCount": { "target": 0 } } } } ``` -------------------------------- ### Calculate Transaction Information Request Samples Source: https://docs.uds.app/index Samples for calculating transaction information, including JSON payload and examples in cURL, PHP, Python, and Node.js. Used to determine available points, discount rates, and accruals. ```json { "code": "string", "participant": { "uid": "string", "phone": "string" }, "receipt": { "total": 0, "skipLoyaltyTotal": 0, "unredeemableTotal": 0, "points": 0 } } ``` ```curl curl -X POST https://api.uds.app/partner/v2/operations/calc \ -H "Content-Type: application/json" \ -d '{ "code": "string", "participant": { "uid": "string", "phone": "string" }, "receipt": { "total": 0, "skipLoyaltyTotal": 0, "unredeemableTotal": 0, "points": 0 } }' ``` ```php 'string', 'participant' => [ 'uid' => 'string', 'phone' => 'string' ], 'receipt' => [ 'total' => 0, 'skipLoyaltyTotal' => 0, 'unredeemableTotal' => 0, 'points' => 0 ] ]; $options = [ 'http' => [ 'method' => 'POST', 'header' => "Content-type: application/json\r\n", 'content' => json_encode($data) ] ]; $context = stream_context_create($options); $result = file_get_contents('https://api.uds.app/partner/v2/operations/calc', false, $context); var_dump($result); ?> ``` ```python import requests import json data = { "code": "string", "participant": { "uid": "string", "phone": "string" }, "receipt": { "total": 0, "skipLoyaltyTotal": 0, "unredeemableTotal": 0, "points": 0 } } response = requests.post('https://api.uds.app/partner/v2/operations/calc', json=data) print(response.json()) ``` ```node const https = require('https'); const data = JSON.stringify({ code: 'string', participant: { uid: 'string', phone: 'string' }, receipt: { total: 0, skipLoyaltyTotal: 0, unredeemableTotal: 0, points: 0 } }); const options = { hostname: 'api.uds.app', port: 443, path: '/partner/v2/operations/calc', method: 'POST', headers: { 'Content-Type': 'application/json', 'Content-Length': data.length } }; const req = https.request(options, (res) => { let responseBody = ''; res.on('data', (chunk) => { responseBody += chunk; }); res.on('end', () => { console.log(JSON.parse(responseBody)); }); }); req.on('error', (error) => { console.error(error); }); req.write(data); req.end(); ``` -------------------------------- ### GET /partner/v2/customers/find Source: https://docs.uds.app/index Searches for a customer by payment code, phone number, or UID. Only one of these parameters is required. ```APIDOC ## GET /partner/v2/customers/find ### Description Searches for a customer by payment code, phone number, or UID. Only one of these parameters is required. ### Method GET ### Endpoint https://api.uds.app/partner/v2/customers/find ### Parameters #### Query Parameters - **code** (string) - Optional - Payment code. - **phone** (string) - Optional - Phone number in E164 format (URL encoded). - **uid** (string) - Optional - Customer UID in the UDS. - **exchangeCode** (boolean) - Optional - Exchange existing payment promo code to a new long-term one. - **total** (number) - Optional - Total bill amount (in currency units). - **skipLoyaltyTotal** (number) - Optional - Amount for which cashback is not credited and discount does not apply (in currency units). - **unredeemableTotal** (number) - Optional - Amount that cannot be redeemed with points. ### Request Example ```bash curl -H 'Accept: application/json' \ -H "X-Origin-Request-Id: $(uuidgen)" \ -H "X-Timestamp: $(date --iso-8601=seconds --utc)" \ -u ":" \ -X GET -s https://api.uds.app/partner/v2/customers/find?code=456123&phone=%2b71234567898&uid=23684cea-ca50-4c5c-b399-eb473e85b5ad ``` ### Response #### Success Response (200) - Customer object (details similar to the response of GET /partner/v2/customers). #### Error Response (404) - Object not found. ``` -------------------------------- ### Create Item/Category - cURL Request Source: https://docs.uds.app/index Example of how to send a POST request to create an item or category using cURL. It includes necessary headers for authentication and content type, along with the request body. ```curl curl -X POST \ https://api.uds.app/partner/v2/goods \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -u ":" \ -d '{ "name": "string", "nodeId": 0, "externalId": "string", "data": { "type": "CATEGORY" }, "hidden": true }' ``` -------------------------------- ### Goods Response Sample (JSON) Source: https://docs.uds.app/index This is a sample JSON response for the GET /goods endpoint, which lists items or categories. It includes an array of 'rows', where each row represents an item or category with its details such as ID, name, type, and creation date. The 'total' field indicates the total number of available items/categories. ```json { "rows": [ { "id": 0, "name": "string", "data": { "type": "CATEGORY" }, "hidden": true, "blocked": true, "nodeId": 0, "imageUrls": [ "string" ], "externalId": "string", "dateCreated": "2025-11-13T08:09:19Z" } ], "total": 0 } ``` -------------------------------- ### GET /partner/v2/goods/{id} Source: https://docs.uds.app/index Retrieves information about a specific item or category using its ID. Requires Basic Authorization. ```APIDOC ## GET /partner/v2/goods/{id} ### Description Retrieves detailed information about a specific item or category by its unique identifier. ### Method GET ### Endpoint https://api.uds.app/partner/v2/goods/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the item or category. ### Request Example (curl) ```bash curl -H 'Accept: application/json' \ -H "X-Origin-Request-Id: $(uuidgen)" \ -H "X-Timestamp: $(date --iso-8601=seconds --utc)" \ -u ":" \ -X GET -s https://api.uds.app/partner/v2/goods/123 ``` ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the item or category. - **name** (string) - The name of the item or category. - **nodeId** (integer) - The ID of the parent category. - **externalId** (string | null) - The external identifier. - **dateCreated** (string) - The date and time when the item or category was created. - **data** (object) - Properties of the item or category. - **type** (string) - The type of the object (`CATEGORY`, `ITEM`, `VARYING_ITEM`). - **hidden** (boolean) - Indicates if the item or category is hidden. - **blocked** (boolean) - Indicates if the item or category is blocked. - **imageUrls** (array) - A list of URLs for the associated images. #### Response Example ```json { "id": 0, "name": "string", "nodeId": 0, "externalId": "string", "dateCreated": "2025-11-13T08:09:19Z", "data": { "type": "CATEGORY" }, "hidden": true, "blocked": true, "imageUrls": [ "string" ] } ``` ### Errors - **401 Unauthorized**: `unauthorized` - Incorrect API key or company ID. ``` -------------------------------- ### Sample JSON Response for User Data Source: https://docs.uds.app/index This JSON structure represents a sample response containing user and loyalty program details. It includes information about membership tiers, discount policies, and other settings. ```json { "id": 0, "name": "string", "promoCode": "string", "currency": "string", "baseDiscountPolicy": "APPLY_DISCOUNT", "loyaltyProgramSettings": { "baseMembershipTier": { "uid": "string", "name": "string", "rate": 0, "maxScoresDiscount": 0, "conditions": { "totalCashSpent": { "target": 0 }, "effectiveInvitedCount": { "target": 0 } } }, "membershipTiers": [ { "uid": "string", "name": "string", "rate": 0, "maxScoresDiscount": 0, "conditions": { "totalCashSpent": { "target": 0 }, "effectiveInvitedCount": { "target": 0 } } } ], "referralCashbackRates": [ 0 ], "cashierAward": 0, "referralReward": 0, "receiptLimit": 0, "deferPointsForDays": 0, "firstPurchasePoints": 0.01 }, "purchaseByPhone": true, "usePointsByPhone": true, "writeInvoice": true, "slug": "string" } ``` -------------------------------- ### Retrieve Company Settings via API Source: https://docs.uds.app/index Fetches company settings, marketing configurations, and invitation promo codes. Requires Basic Authentication and specific headers like 'X-Origin-Request-Id' and 'X-Timestamp'. ```curl curl -H 'Accept: application/json' \ -H "X-Origin-Request-Id: $(uuidgen)" \ -H "X-Timestamp: $(date --iso-8601=seconds --utc)" \ -u ":" \ -X GET -s https://api.uds.app/partner/v2/settings ``` -------------------------------- ### Get Item/Category Information - cURL Request Source: https://docs.uds.app/index Shows how to retrieve information about a specific item or category using its ID via a cURL GET request. Includes necessary headers for authentication and request ID. ```curl curl -H 'Accept: application/json' \ -H "X-Origin-Request-Id: $(uuidgen)" \ -H "X-Timestamp: $(date --iso-8601=seconds --utc)" \ -u ":" \ -X GET -s https://api.uds.app/partner/v2/goods/123 ``` -------------------------------- ### Website Data Structure Source: https://docs.uds.app/index Structure of website data, including promotional information and loyalty program settings. ```APIDOC ## Website Data Structure Represents the data structure for website information, including promotional codes and loyalty program settings. ### Fields - **id** (integer) - The unique identifier of the website. - **name** (string) - The name of the website. - **promoCode** (string) - A promotional code associated with the website. - **currency** (string) - The currency used by the website. - **baseDiscountPolicy** (string) - The base discount policy ('APPLY_DISCOUNT' or 'CHARGE_SCORES'). - **loyaltyProgramSettings** (object) - Settings for the loyalty program. - **baseMembershipTier** (object) - The base membership tier details. - **uid** (string) - Unique identifier for the tier. - **name** (string) - Name of the tier. - **rate** (number) - Associated rate. - **maxScoresDiscount** (number) - Maximum discount using scores. - **conditions** (object) - Conditions for the tier. - **totalCashSpent** (object) - **target** (number) - Target for total cash spent. - **effectiveInvitedCount** (object) - **target** (number) - Target for effective invited count. - **membershipTiers** (array) - A list of other membership tiers. - (object) - Details of a membership tier (same structure as `baseMembershipTier`). - **referralCashbackRates** (array) - List of referral cashback rates (numbers). - **cashierAward** (number) - Award for cashiers. - **referralReward** (number) - Reward for referrals. - **receiptLimit** (number) - Limit for receipts. - **deferPointsForDays** (number) - Days to defer points. - **firstPurchasePoints** (number) - Points for the first purchase. - **purchaseByPhone** (boolean) - Whether purchase by phone is enabled. - **usePointsByPhone** (boolean) - Whether using points by phone is enabled. - **writeInvoice** (boolean) - Whether to write an invoice. - **slug** (string) - A URL-friendly identifier for the website. ### Response Example (200) ```json { "id": 0, "name": "string", "promoCode": "string", "currency": "string", "baseDiscountPolicy": "APPLY_DISCOUNT", "loyaltyProgramSettings": { "baseMembershipTier": { "uid": "string", "name": "string", "rate": 0, "maxScoresDiscount": 0, "conditions": { "totalCashSpent": { "target": 0 }, "effectiveInvitedCount": { "target": 0 } } }, "membershipTiers": [ { "uid": "string", "name": "string", "rate": 0, "maxScoresDiscount": 0, "conditions": { "totalCashSpent": { "target": 0 }, "effectiveInvitedCount": { "target": 0 } } } ], "referralCashbackRates": [ 0 ], "cashierAward": 0, "referralReward": 0, "receiptLimit": 0, "deferPointsForDays": 0, "firstPurchasePoints": 0.01 }, "purchaseByPhone": true, "usePointsByPhone": true, "writeInvoice": true, "slug": "string" } ``` ``` -------------------------------- ### Get Operation Request Sample (PHP) Source: https://docs.uds.app/index This PHP code snippet shows how to retrieve transaction information using cURL. It sets the necessary headers, including authorization, and makes a GET request to the UDS API. ```php = 200 && $httpCode < 300) { return json_decode($response, true); } else { echo "HTTP Error: {$httpCode}" . PHP_EOL; return null; } } // Example usage: // $operation = getOperation('123', 'YOUR_COMPANY_ID', 'YOUR_API_KEY'); // print_r($operation); ?> ``` -------------------------------- ### Sample JSON Response for Transaction List Source: https://docs.uds.app/index This JSON structure represents a sample response for a list of transactions. It includes details about each transaction, such as date, action, customer, and total amount. ```json { "rows": { "id": 0, "dateCreated": "2025-11-13T08:09:19Z", "action": "PURCHASE", "state": "NORMAL", "customer": { "id": 0, "displayName": "string", "uid": null, "membershipTier": { "uid": "string", "name": "string", "rate": 0, "maxScoresDiscount": 0, "conditions": { "totalCashSpent": { "target": 0 }, "effectiveInvitedCount": { "target": 0 } } } }, "cashier": { "id": 0, "displayName": "string" }, "branch": { "id": 0, "displayName": "string" }, "points": 0, "certificatePoints": 0, "receiptNumber": "string", "origin": { "id": 0 } }, "total": 0, "cursor": "string" } ``` -------------------------------- ### GET /partner/v2/customers/{id}/tags Source: https://docs.uds.app/index Retrieves a list of tags associated with a specific customer. ```APIDOC ## GET /partner/v2/customers/{id}/tags ### Description Retrieves a list of tags associated with a specific customer using their unique ID. ### Method GET ### Endpoint https://api.uds.app/partner/v2/customers/{id}/tags ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the customer. ### Request Example ```curl curl -H 'Accept: application/json' \ -H "X-Origin-Request-Id: $(uuidgen)" \ -H "X-Timestamp: $(date --iso-8601=seconds --utc)" \ -u ":" \ -X GET -s https://api.uds.app/partner/v2/customers//tags ``` ### Response #### Success Response (200) - **rows** (array) - A list of tag objects. - **id** (integer) - The unique identifier of the tag. - **name** (string) - The name of the tag. - **total** (integer) - The total number of tags available. #### Response Example (200) ```json { "rows": [ { "id": 1, "name": "string" } ], "total": 0 } ``` #### Error Response (404) Object not found. ``` -------------------------------- ### Settings API Source: https://docs.uds.app/index Provides endpoints for retrieving company settings. ```APIDOC ## GET /settings ### Description Retrieves the company settings. ### Method GET ### Endpoint `/settings` ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **settings** (object) - Object containing company settings. #### Response Example ```json { "settings": { "company_name": "Example Corp", "currency": "USD" } } ``` ``` -------------------------------- ### GET /partner/v2/customers Source: https://docs.uds.app/index Retrieves a list of company users (customers). Supports pagination and filtering. ```APIDOC ## GET /partner/v2/customers ### Description Retrieves a list of company users (customers). Supports pagination and filtering. ### Method GET ### Endpoint https://api.uds.app/partner/v2/customers ### Parameters #### Query Parameters - **max** (integer) - Optional - Limit number of results in response. Maximum value is 50. - **offset** (integer) - Optional - Rows count to skip. Maximum value is 10000. - **cursor** (string) - Optional - Paginate results by cursor. ### Request Example ```bash curl -H 'Accept: application/json' \ -H "X-Origin-Request-Id: $(uuidgen)" \ -H "X-Timestamp: $(date --iso-8601=seconds --utc)" \ -u ":" \ -X GET -s https://api.uds.app/partner/v2/customers?max=10&offset=0 ``` ### Response #### Success Response (200) - **rows** (Array) - List of customers. - **uid** (string) - **avatar** (string) - **displayName** (string) - **gender** (string, enum: MALE) - **phone** (string) - **birthDate** (string, format: date) - **participant** (object) - **id** (integer) - **inviterId** (integer) - **points** (number) - **discountRate** (number) - **cashbackRate** (number) - **cashSpent** (number) - **savedFunds** (number) - **invitedCount** (integer) - **effectiveInvitedCount** (integer) - **operationsCount** (integer) - **fullRefundsCount** (integer) - **note** (string) - **membershipTier** (object) - **uid** (string) - **name** (string) - **rate** (number) - **maxScoresDiscount** (number) - **conditions** (object) - **totalCashSpent** (object) - **target** (number) - **effectiveInvitedCount** (object) - **target** (number) - **dateCreated** (string, format: date-time) - **lastTransactionTime** (string, format: date-time) - **pointsExpireIn** (string, format: date-time) - **channelName** (string) - **email** (string) #### Response Example ```json { "rows": [ { "uid": "string", "avatar": "string", "displayName": "string", "gender": "MALE", "phone": "string", "birthDate": "2025-11-13", "participant": { "id": 0, "inviterId": 0, "points": 0, "discountRate": 0, "cashbackRate": 0, "cashSpent": 0, "savedFunds": 0, "invitedCount": 0, "effectiveInvitedCount": 0, "operationsCount": 0, "fullRefundsCount": 0, "note": "string", "membershipTier": { "uid": "string", "name": "string", "rate": 0, "maxScoresDiscount": 0, "conditions": { "totalCashSpent": { "target": 0 }, "effectiveInvitedCount": { "target": 0 } } }, "dateCreated": "2025-11-13T08:09:19Z", "lastTransactionTime": "2025-11-13T08:09:19Z", "pointsExpireIn": "2025-11-13T08:09:19Z" }, "channelName": "string", "email": "string" } ] } ``` ```