### Example API Request to Get Products Source: https://poswithlogic.dev/documentation Example cURL command to fetch products using the API. Ensure your API key has the 'product:get' scope. ```bash curl -X GET https://api.poswithlogic.dev/products \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" ``` -------------------------------- ### Example Response: All Customers Source: https://poswithlogic.dev/api/customers This is an example of a successful response when retrieving a list of customers, including their details and pagination information. ```json { "results": [ { "id": "id", "firstName": "firstName", "lastName": "lastName", "phone": "phone", "phones": [ "string" ], "email": "test@example.com", "address": { "addressLine1": "addressLine1", "addressLine2": "addressLine2", "city": "city", "state": "state", "zipCode": "zipCode" }, "customerCreditCards": [ { "id": "id", "masked": "masked", "exp": "exp", "name": "name", "zipCode": "zipCode", "issuer": "issuer" } ], "shippingAddresses": [ { "addressLine1": "addressLine1", "addressLine2": "addressLine2", "city": "city", "state": "state", "zipCode": "zipCode", "name": "name", "custid": "custid", "id": "id" } ], "lastModified": "2024-08-25T15:00:00Z" } ], "hasMore": true, "cursor": "cursor", "total": 0 } ``` -------------------------------- ### GET Order by externalOrderId (Java) Source: https://poswithlogic.dev/api/orders Java example for fetching order details using the external order ID. Authentication is handled via the 'x-api-key' header. ```java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.poswithlogic.dev/orders/external/:externalOrderId") .get() .addHeader("x-api-key", "") .build(); Response response = client.newCall(request).execute(); // Handle response ``` -------------------------------- ### GET Order by externalOrderId (Kotlin) Source: https://poswithlogic.dev/api/orders Kotlin example for retrieving an order by its external identifier. The API key should be passed in the 'x-api-key' header. ```kotlin import okhttp3.OkHttpClient import okhttp3.Request fun main() { val client = OkHttpClient() val request = Request.Builder() .url("https://api.poswithlogic.dev/orders/external/:externalOrderId") .get() .addHeader("x-api-key", "") .build() val response = client.newCall(request).execute() // Handle response } ``` -------------------------------- ### GET Order by externalOrderId (JavaScript) Source: https://poswithlogic.dev/api/orders Example of fetching order details by externalOrderId using JavaScript. Requires an API key for authentication. ```javascript fetch('https://api.poswithlogic.dev/orders/external/:externalOrderId', { method: 'GET', headers: { 'x-api-key': '' } }) .then(response => { // Handle response }) .catch(error => { // Handle error }); ``` -------------------------------- ### Example Response: Customer Credit Cards Source: https://poswithlogic.dev/api/customers An example of the JSON response when successfully retrieving a customer's credit card information. ```json [ { "id": "id", "masked": "masked", "exp": "exp", "name": "name", "zipCode": "zipCode", "issuer": "issuer" } ] ``` -------------------------------- ### Get Product by ID (cURL) Source: https://poswithlogic.dev/api/products Use this cURL command to make a GET request to retrieve product details by its ID. Replace :id with the actual product ID and with your API key. ```shell curl --request GET \ --url https://api.poswithlogic.dev/products/id/:id \ --header 'x-api-key: ' ``` -------------------------------- ### Get Order by ID Request Example Source: https://poswithlogic.dev/documentation Use this `curl` command to retrieve an order by its internal identifier. Ensure you replace `YOUR_API_KEY` with your actual API key. ```bash curl -X GET https://api.poswithlogic.dev/orders/id/15007763 \ -H "x-api-key: YOUR_API_KEY" ``` -------------------------------- ### GET Order by externalOrderId (Swift) Source: https://poswithlogic.dev/api/orders Swift example for retrieving an order using its external identifier. The API key is required in the 'x-api-key' header. ```swift import Foundation func getOrder(externalOrderId: String, apiKey: String) { guard let url = URL(string: "https://api.poswithlogic.dev/orders/external/\(externalOrderId)") else { return } var request = URLRequest(url: url) request.httpMethod = "GET" request.setValue(apiKey, forHTTPHeaderField: "x-api-key") let task = URLSession.shared.dataTask(with: request) { data, response, error in if let error = error { print("Error: \(error.localizedDescription)") return } guard let data = data else { return } let responseString = String(data: data, encoding: .utf8) print("Response: \(responseString ?? "")") // Process the response data } task.resume() } ``` -------------------------------- ### Get Customer Credit Card by ID cURL Example Source: https://poswithlogic.dev/api/customers This cURL command demonstrates how to retrieve a customer's credit card information by ID. Ensure you include the 'x-api-key' header for authentication. The response will contain masked card details. ```shell curl --request GET \ --url https://api.poswithlogic.dev/customers/id/:customerId/cards/:cardId \ --header 'x-api-key: ' ``` -------------------------------- ### Example Invoice Response (200 OK) Source: https://poswithlogic.dev/api/invoices This is an example of a successful response when retrieving invoice details. It includes comprehensive information about the invoice, its items, and associated payments. ```json { "invoiceNumber": "invoiceNumber", "registerNumber": 0, "externalInvoiceId": "externalInvoiceId", "customerId": "customerId", "orderNumber": "orderNumber", "invoiceDate": "2024-08-25T15:00:00Z", "totalAmount": 0, "taxAmount": 0, "taxableAmount": 0, "discountAmount": 0, "subtotalAmount": 0, "memo": "memo", "deliveryAddress": { "name": "name", "phoneNumber": "phoneNumber", "address": { "addressLine1": "addressLine1", "addressLine2": "addressLine2", "city": "city", "state": "state", "zipCode": "zipCode" } }, "items": [ { "productId": "productId", "quantity": 0, "priceQty": 0, "unitPrice": 0, "taxable": true, "isFoodStampItem": true, "discountAmount": 0, "discountPercentage": 0, "priceType": "Regular", "subtotalAmount": 0 } ], "payments": [ { "paymentMethod": "CreditCard", "amount": 0, "referenceNo": "referenceNo", "dateTime": "2024-08-25T15:00:00Z", "maskedCreditCardNumber": "maskedCreditCardNumber", "cardholderName": "cardholderName", "authorizationCode": "authorizationCode" } ] } ``` -------------------------------- ### GET /products Source: https://poswithlogic.dev/documentation Retrieves a list of all products. This endpoint is accessible to all users. ```APIDOC ## GET /products ### Description GET Products. ### Method GET ### Endpoint /products ### Parameters #### Query Parameters - **scope** (string) - Required - `product:get` ### Response #### Success Response (200) - **products** (array) - Description of products #### Response Example ```json { "products": [ { "id": "prod_123", "name": "Sample Product", "price": 19.99 } ] } ``` ``` -------------------------------- ### Get Order by External ID Request Example Source: https://poswithlogic.dev/documentation Use this `curl` command to retrieve an order using its external identifier. Replace `YOUR_API_KEY` with your valid API key. ```bash curl -X GET https://api.poswithlogic.dev/orders/external/ext-order-123 \ -H "x-api-key: YOUR_API_KEY" ``` -------------------------------- ### GET /customers Source: https://poswithlogic.dev/documentation Retrieves a list of all customers. Requires the `customer:get` scope. ```APIDOC ## GET /customers ### Description GET All Customers. ### Method GET ### Endpoint /customers ### Parameters #### Query Parameters - **scope** (string) - Required - `customer:get` ### Response #### Success Response (200) - **customers** (array) - Description of customers #### Response Example ```json { "customers": [ { "id": "cust_123", "name": "John Doe", "phone": "123-456-7890" } ] } ``` ``` -------------------------------- ### Customer Card Response Example Source: https://poswithlogic.dev/documentation Example structure of a credit card object returned for a customer. Includes masked card number, expiration date, and issuer. ```json [ { "id": "CC001", "masked": "************1234", "exp": "0627", "name": "John Doe", "zipCode": "10001", "issuer": "Visa" } ] ``` -------------------------------- ### GET /products/code/{code} Source: https://poswithlogic.dev/documentation Retrieves products by their code. This endpoint is accessible to all users. ```APIDOC ## GET /products/code/{code} ### Description GET Products by code. ### Method GET ### Endpoint /products/code/{code} ### Parameters #### Path Parameters - **code** (string) - Required - The product code. #### Query Parameters - **scope** (string) - Required - `product:get` ### Response #### Success Response (200) - **products** (array) - Description of products #### Response Example ```json { "products": [ { "id": "prod_123", "name": "Sample Product", "code": "SAMPLE-001", "price": 19.99 } ] } ``` ``` -------------------------------- ### Get Product by Code Source: https://poswithlogic.dev/documentation Retrieve a specific product using its SKU or item code. ```APIDOC ## GET /products/code/{code} ### Description Retrieve a specific product using its SKU or item code. ### Method GET ### Endpoint /products/code/{code} ### Parameters #### Path Parameters - **code** (string) - Required - Product SKU or item code ### Request Example ```bash curl -X GET https://api.poswithlogic.dev/products/code/PROD001 \ -H "x-api-key: YOUR_API_KEY" ``` ### Response #### Success Response (200) - **product** (object) - The product object. #### Response Example ```json { "id": "67890", "code": "PROD001", "name": "Product by Code", "price": 15.00, "priceQty": 1 } ``` ``` -------------------------------- ### GET /customers/id/{customerId} Source: https://poswithlogic.dev/documentation Retrieves a customer by their ID. Requires the `customer:get` scope. ```APIDOC ## GET /customers/id/{customerId} ### Description GET Customer by id. ### Method GET ### Endpoint /customers/id/{customerId} ### Parameters #### Path Parameters - **customerId** (string) - Required - The ID of the customer. #### Query Parameters - **scope** (string) - Required - `customer:get` ### Response #### Success Response (200) - **customer** (object) - Description of the customer #### Response Example ```json { "customer": { "id": "cust_123", "name": "John Doe", "phone": "123-456-7890" } } ``` ``` -------------------------------- ### Example Success Response for Card Charge Source: https://poswithlogic.dev/api/customers This is an example of a successful response (200 OK) after charging a customer's credit card. It includes details like the amount charged, authorization code, gateway reference number, masked card number, and the customer's new balance. ```json { "amountCharged": 0, "authCode": "authCode", "referenceNo": "referenceNo", "maskedCardNumber": "maskedCardNumber", "newBalance": 0 } ``` -------------------------------- ### GET Products by id Source: https://poswithlogic.dev/api/products Looks up a product by its numeric ID or any of its aliases. ```APIDOC ## GET /products/id/{id} ### Description Looks up a product by its numeric ID or any of its aliases. Aliases are alternate codes that resolve to the same product record. ### Method GET ### Endpoint https://api.poswithlogic.dev/products/id/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique numeric identifier of the product or its alias. #### Headers - **x-api-key** (string) - Required - The `x-api-key` header is used to authenticate with the API using your API key. Value is of the format `YOUR_KEY_HERE`. ### Response #### Success Response (200) (Response details for this endpoint are not provided in the source text.) #### Response Example (Response example for this endpoint is not provided in the source text.) ``` -------------------------------- ### GET Products by code Source: https://poswithlogic.dev/api/products Retrieves detailed information about a product using its item code. ```APIDOC ## GET /products/code/{code} ### Description Returns the product details. ### Method GET ### Endpoint https://api.poswithlogic.dev/products/code/:code ### Parameters #### Path Parameters - **code** (string) - Required - The item code or SKU of the product. #### Request Body None ### Response #### Success Response (200) - **prices** (object[]) - Required - List of prices for the item. - **taxRate** (number) - Required - Tax rate for the item. - **active** (boolean) - Required - Value indicating whether the item is active. - **aliases** (object[]) - Required - List of aliases for the item. - **onHand** (number) - Required - Quantity on hand for the item. - **lastModified** (string) - Required - Date and time when the product was last modified. - **id** (string | null) - Unique identifier for the product. - **itemCode** (string | null) - Item code/SKU. - **primaryCode** (string | null) - Primary code for the item. - **description** (string | null) - Description of the product. - **brand** (string | null) - Brand of the item. - **manufacturer** (string | null) - Manufacturer of the item. - **byMeasure** (boolean) - Value indicating whether the item is sold by weight (LB). - **lastSold** (string | null) - Date when the item was last sold. - **size** (number | null) - Size of the item. - **caseQty** (integer) - Case quantity of the item. - **tax** (boolean) - Value indicating whether the item is taxable. - **ebt** (boolean | null) - Value indicating whether the item is eligible for EBT. - **unit** (string | null) - Unit of measure for the size. - **excludeFromDiscount** (boolean | null) - Value indicating whether the item is excluded from discounts. - **categoryName** (string | null) - Category name of the item. - **subCategoryName** (string | null) - Sub-category name of the item. - **ageRestriction** (integer | null) - Gets the age restriction for the associated content, if any. - **location** (string | null) - The shelf location of the product. - **priceDiscount** (object) - Represents a price discount applicable on specific days of the week. - **wicEligible** (boolean | null) - If the product is a WIC eligible item. - **tagAlongs** (array | null) - List of tag-along items (components) associated with this product. - **tags** (array | null) - Search tags for the product. #### Response Example ```json { "id": "id", "itemCode": "itemCode", "primaryCode": "primaryCode", "description": "description", "brand": "brand", "manufacturer": "manufacturer", "byMeasure": true, "lastSold": "2024-08-25", "size": 0, "caseQty": 0, "tax": true, "ebt": true, "unit": "unit", "excludeFromDiscount": true, "categoryName": "categoryName", "subCategoryName": "subCategoryName", "prices": [ { "qty": 0, "priceQtyType": "Bulk", "price": 0, "priceType": "Regular", "priceFrom": "2024-08-25T15:00:00Z", "priceTill": "2024-08-25T15:00:00Z", "cashAndCarryOnly": true, "priceTimeFrom": "15:00:00", "priceTimeTill": "15:00:00", "daysOfWeek": [ "Sunday" ], "membersOnly": true, "minimumPurchase": 0, "maxQty": 0, "name": "Regular" } ], "taxRate": 0, "active": true, "aliases": [ { "id": "id", "productId": "productId", "code": "code", "description": "description", "case": true } ], "onHand": 0, "lastModified": "2024-08-25T15:00:00Z", "ageRestriction": 0, "location": "location", "priceDiscount": { "amount": 0, "daysOfWeek": [ "Sunday" ] }, "wicEligible": true, "tagAlongs": [ { "itemId": "itemId", "quantity": 0 } ], "tags": [ "string" ] } ``` ``` -------------------------------- ### Get Product by ID Source: https://poswithlogic.dev/documentation Retrieve a specific product using its unique identifier. ```APIDOC ## GET /products/id/{id} ### Description Retrieve a specific product using its unique identifier. ### Method GET ### Endpoint /products/id/{id} ### Parameters #### Path Parameters - **id** (string) - Required - Numeric product identifier ### Request Example ```bash curl -X GET https://api.poswithlogic.dev/products/id/12345 \ -H "x-api-key: YOUR_API_KEY" ``` ### Response #### Success Response (200) - **product** (object) - The product object. #### Response Example ```json { "id": "12345", "name": "Specific Product", "price": 25.50, "priceQty": 1 } ``` ``` -------------------------------- ### GET /products/id/{id} Source: https://poswithlogic.dev/documentation Retrieves products by their ID. This endpoint is accessible to all users. ```APIDOC ## GET /products/id/{id} ### Description GET Products by id. ### Method GET ### Endpoint /products/id/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The product ID. #### Query Parameters - **scope** (string) - Required - `product:get` ### Response #### Success Response (200) - **products** (array) - Description of products #### Response Example ```json { "products": [ { "id": "prod_123", "name": "Sample Product", "price": 19.99 } ] } ``` ``` -------------------------------- ### Example Order Creation Response Headers Source: https://poswithlogic.dev/documentation A successful order creation returns a 201 Created status code and a Location header with the URL to retrieve the created order. ```http HTTP/1.1 201 Created Location: /orders/id/15007763 ``` -------------------------------- ### Understanding Product Pricing Source: https://poswithlogic.dev/documentation Explanation of how product pricing is calculated using the `price` and `priceQty` fields. ```APIDOC ## Understanding Product Pricing ### The `priceQty` Field The `priceQty` field is a divisor that determines the actual unit price. ``` Unit Price = price ÷ priceQty ``` **Example:** * `price: 10.00` * `priceQty: 2` * **Unit Price: $5.00** **Common Use Cases:** * Bulk pricing: "2 for $10" promotions * Fractional pricing: Items sold by weight or volume * Multi-pack items: Cases or bundles sold as individual units ``` -------------------------------- ### Product Response Example Source: https://poswithlogic.dev/api/products This JSON object represents a successful response when retrieving a product by its code. It includes detailed information about the product, its pricing, aliases, and inventory. ```json { "id": "id", "itemCode": "itemCode", "primaryCode": "primaryCode", "description": "description", "brand": "brand", "manufacturer": "manufacturer", "byMeasure": true, "lastSold": "2024-08-25", "size": 0, "caseQty": 0, "tax": true, "ebt": true, "unit": "unit", "excludeFromDiscount": true, "categoryName": "categoryName", "subCategoryName": "subCategoryName", "prices": [ { "qty": 0, "priceQtyType": "Bulk", "price": 0, "priceType": "Regular", "priceFrom": "2024-08-25T15:00:00Z", "priceTill": "2024-08-25T15:00:00Z", "cashAndCarryOnly": true, "priceTimeFrom": "15:00:00", "priceTimeTill": "15:00:00", "daysOfWeek": [ "Sunday" ], "membersOnly": true, "minimumPurchase": 0, "maxQty": 0, "name": "Regular" } ], "taxRate": 0, "active": true, "aliases": [ { "id": "id", "productId": "productId", "code": "code", "description": "description", "case": true } ], "onHand": 0, "lastModified": "2024-08-25T15:00:00Z", "ageRestriction": 0, "location": "location", "priceDiscount": { "amount": 0, "daysOfWeek": [ "Sunday" ] }, "wicEligible": true, "tagAlongs": [ { "itemId": "itemId", "quantity": 0 } ], "tags": [ "string" ] } ``` -------------------------------- ### List Products using cURL Source: https://poswithlogic.dev/api/products Use this cURL command to retrieve a paginated list of products. Ensure you replace `` with your actual API key. ```shell curl --request GET \ --url https://api.poswithlogic.dev/products \ --header 'x-api-key: ' ``` -------------------------------- ### Example Product List Response Source: https://poswithlogic.dev/api/products This JSON structure represents a successful response when listing products, including details about each product and pagination information. ```json { "results": [ { "id": "id", "itemCode": "itemCode", "primaryCode": "primaryCode", "description": "description", "brand": "brand", "manufacturer": "manufacturer", "byMeasure": true, "lastSold": "2024-08-25", "size": 0, "caseQty": 0, "tax": true, "ebt": true, "unit": "unit", "excludeFromDiscount": true, "categoryName": "categoryName", "subCategoryName": "subCategoryName", "prices": [ { "qty": 0, "priceQtyType": "Bulk", "price": 0, "priceType": "Regular", "priceFrom": "2024-08-25T15:00:00Z", "priceTill": "2024-08-25T15:00:00Z", "cashAndCarryOnly": true, "priceTimeFrom": "15:00:00", "priceTimeTill": "15:00:00", "daysOfWeek": [ "Sunday" ], "membersOnly": true, "minimumPurchase": 0, "maxQty": 0, "name": "Regular" } ], "taxRate": 0, "active": true, "aliases": [ { "id": "id", "productId": "productId", "code": "code", "description": "description", "case": true } ], "onHand": 0, "lastModified": "2024-08-25T15:00:00Z", "ageRestriction": 0, "location": "location", "priceDiscount": { "amount": 0, "daysOfWeek": [ "Sunday" ] }, "wicEligible": true, "tagAlongs": [ { "itemId": "itemId", "quantity": 0 } ], "tags": [ "string" ] } ], "hasMore": true, "cursor": "cursor", "total": 0 } ``` -------------------------------- ### GET Order by externalOrderId Response Example Source: https://poswithlogic.dev/api/orders This JSON structure represents a successful response when retrieving order details using the external order ID. It includes all relevant order information. ```json { "id": "id", "externalOrderId": "externalOrderId", "customerId": "customerId", "items": [ { "id": "id", "orderId": "orderId", "productId": "productId", "description": "description", "quantity": 0, "priceQty": 0, "unitOfMeasure": "Unit", "unitPrice": 0, "totalPrice": 0, "note": "note", "productCode": "productCode" } ], "deliveryAddress": { "name": "name", "phoneNumber": "phoneNumber", "address": { "addressLine1": "addressLine1", "addressLine2": "addressLine2", "city": "city", "state": "state", "zipCode": "zipCode" } }, "orderMethod": "Pickup", "invoiceNumber": "invoiceNumber", "pickupDeliveryTime": "2024-08-25T15:00:00Z", "status": "OrderEntered", "note": "note", "paymentEndpoint": { "url": "url", "headers": { "key": "string" } }, "paymentMethod": "OnAccount", "cardLast4": "cardLast4", "cardExp": "cardExp", "dateTimeCreated": "2024-08-25" } ``` -------------------------------- ### GET Customer by ID JSON Response Source: https://poswithlogic.dev/api/customers This is an example of a successful JSON response when retrieving customer details by ID. It includes personal information, contact details, addresses, and associated credit card and shipping information. ```json { "id": "id", "firstName": "firstName", "lastName": "lastName", "phone": "phone", "phones": [ "string" ], "email": "test@example.com", "address": { "addressLine1": "addressLine1", "addressLine2": "addressLine2", "city": "city", "state": "state", "zipCode": "zipCode" }, "customerCreditCards": [ { "id": "id", "masked": "masked", "exp": "exp", "name": "name", "zipCode": "zipCode", "issuer": "issuer" } ], "shippingAddresses": [ { "addressLine1": "addressLine1", "addressLine2": "addressLine2", "city": "city", "state": "state", "zipCode": "zipCode", "name": "name", "custid": "custid", "id": "id" } ], "lastModified": "2024-08-25T15:00:00Z" } ``` -------------------------------- ### Fetch Product by Code using cURL Source: https://poswithlogic.dev/api/products This cURL command demonstrates how to retrieve a specific product using its SKU or item code. Replace `` with your API key and `{code}` with the product's code. ```shell curl --request GET \ --url https://api.poswithlogic.dev/products/code/{code} \ --header 'x-api-key: ' ``` -------------------------------- ### Incremental Product Sync Workflow Source: https://poswithlogic.dev/documentation Demonstrates a pattern for efficiently syncing product data by leveraging the `lastMod` timestamp and `cursor` for pagination. Store the `lastMod` from the previous sync to fetch only updated products in subsequent requests. ```curl # Initial sync — response includes total count curl -X GET "https://api.poswithlogic.dev/products?take=100" \ -H "x-api-key: YOUR_API_KEY" ``` ```curl # Subsequent sync — only modified products curl -X GET "https://api.poswithlogic.dev/products?take=100&lastMod=2024-12-26T10:30:00Z" \ -H "x-api-key: YOUR_API_KEY" ``` ```curl # Paginate — include all original params alongside cursor curl -X GET "https://api.poswithlogic.dev/products?take=100&lastMod=2024-12-26T10:30:00Z&cursor=CURSOR_FROM_RESPONSE" \ -H "x-api-key: YOUR_API_KEY" ``` -------------------------------- ### Get Customer by ID API Endpoint Source: https://poswithlogic.dev/api/customers This section describes the GET /customers/id/{id} endpoint for looking up a customer by their internal ID. Access is controlled by scopes: 'customer:get:own' for associated orders and 'customer:get:all' for all customers. -------------------------------- ### Calculate Unit Price Source: https://poswithlogic.dev/documentation Demonstrates how to calculate the actual unit price of a product using the `price` and `priceQty` fields. This is essential for understanding bulk or fractional pricing. ```plaintext Unit Price = price ÷ priceQty ``` -------------------------------- ### Get Product by Code Request Source: https://poswithlogic.dev/api/products Use this cURL command to retrieve product details by its code. Ensure you replace ':code' with the actual product code and '' with your valid API key. ```shell curl --request GET \ --url https://api.poswithlogic.dev/products/code/:code \ --header 'x-api-key: ' ``` -------------------------------- ### GET /orders/id/{id} Source: https://poswithlogic.dev/documentation Retrieves an order by its ID. Requires the `order:get` scope. ```APIDOC ## GET /orders/id/{id} ### Description GET Order by id. ### Method GET ### Endpoint /orders/id/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the order. #### Query Parameters - **scope** (string) - Required - `order:get` ### Response #### Success Response (200) - **order** (object) - Description of the order #### Response Example ```json { "order": { "orderId": "order_xyz", "customerId": "cust_123" } } ``` ``` -------------------------------- ### GET /invoices/id/{id} Source: https://poswithlogic.dev/documentation Retrieves an invoice by its ID. Requires the `invoice:get` scope. ```APIDOC ## GET /invoices/id/{id} ### Description GET Invoice by id. ### Method GET ### Endpoint /invoices/id/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the invoice. #### Query Parameters - **scope** (string) - Required - `invoice:get` ### Response #### Success Response (200) - **invoice** (object) - Description of the invoice #### Response Example ```json { "invoice": { "invoiceId": "inv_xyz", "orderId": "order_abc" } } ``` ``` -------------------------------- ### GET /customers/phonenumber/{phoneNumber} Source: https://poswithlogic.dev/documentation Retrieves a customer by their phone number. Requires the `customer:get` scope. ```APIDOC ## GET /customers/phonenumber/{phoneNumber} ### Description GET Customer by phone number. ### Method GET ### Endpoint /customers/phonenumber/{phoneNumber} ### Parameters #### Path Parameters - **phoneNumber** (string) - Required - The phone number of the customer. #### Query Parameters - **scope** (string) - Required - `customer:get` ### Response #### Success Response (200) - **customer** (object) - Description of the customer #### Response Example ```json { "customer": { "id": "cust_123", "name": "John Doe", "phone": "123-456-7890" } } ``` ``` -------------------------------- ### GET /customers/id/{id} Source: https://poswithlogic.dev/api/customers Get Customer by id. Looks up a customer by their internal customer ID. ```APIDOC ## GET /customers/id/{id} ### Description Looks up a customer by their internal customer ID. With the `customer:get:own` scope, only customers associated with orders created by your API key are visible; `customer:get:all` exposes every customer in the account. ### Method GET ### Endpoint /customers/id/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the customer. #### Headers - **x-api-key** (string) - Required - The `x-api-key` header is used to authenticate with the API using your API key. Value is of the format `YOUR_KEY_HERE`. ``` -------------------------------- ### Example Order Creation JSON Request Body Source: https://poswithlogic.dev/api/orders This JSON object represents a complete request body for creating an order. It includes customer details, items, delivery information, and payment configuration. ```json { "externalOrderId": "externalOrderId", "customerId": "customerId", "customer": { "firstName": "firstName", "lastName": "lastName", "phone": "phone", "email": "test@example.com", "address": { "addressLine1": "addressLine1", "addressLine2": "addressLine2", "city": "city", "state": "state", "zipCode": "zipCode" } }, "status": "OrderEntered", "items": [ { "productCode": "productCode", "description": "description", "quantity": 0, "priceQty": 0, "unitOfMeasure": "Unit", "unitPrice": 0, "totalPrice": 0, "note": "note" } ], "deliveryAddress": { "name": "name", "phoneNumber": "phoneNumber", "address": { "addressLine1": "addressLine1", "addressLine2": "addressLine2", "city": "city", "state": "state", "zipCode": "zipCode" } }, "orderMethod": "Pickup", "pickupDeliveryTime": "2024-08-25T15:00:00Z", "note": "note", "paymentEndpoint": { "url": "url", "headers": { "key": "string" } }, "payment": { "method": "OnAccount", "cardId": "cardId", "card": { "cardNumber": "cardNumber", "expMonth": 1, "expYear": 0, "cvv": "cvv", "name": "name", "zip": "zip", "houseNumber": "houseNumber" } } } ``` -------------------------------- ### GET /orders/external/{externalOrderId} Source: https://poswithlogic.dev/documentation Retrieves an order by its external order ID. Requires the `order:get` scope. ```APIDOC ## GET /orders/external/{externalOrderId} ### Description GET Order by externalOrderId. ### Method GET ### Endpoint /orders/external/{externalOrderId} ### Parameters #### Path Parameters - **externalOrderId** (string) - Required - The external order ID. #### Query Parameters - **scope** (string) - Required - `order:get` ### Response #### Success Response (200) - **order** (object) - Description of the order #### Response Example ```json { "order": { "orderId": "order_xyz", "externalOrderId": "ext_order_456" } } ``` ``` -------------------------------- ### GET /invoices/externalorderid/{externalOrderId} Source: https://poswithlogic.dev/documentation Retrieves an invoice by its external order ID. Requires the `invoice:get` scope. ```APIDOC ## GET /invoices/externalorderid/{externalOrderId} ### Description GET Invoice by externalOrderId. ### Method GET ### Endpoint /invoices/externalorderid/{externalOrderId} ### Parameters #### Path Parameters - **externalOrderId** (string) - Required - The external order ID. #### Query Parameters - **scope** (string) - Required - `invoice:get` ### Response #### Success Response (200) - **invoice** (object) - Description of the invoice #### Response Example ```json { "invoice": { "invoiceId": "inv_xyz", "externalOrderId": "ext_order_456" } } ``` ``` -------------------------------- ### GET /invoices/externalinvoiceid/{externalInvoiceId} Source: https://poswithlogic.dev/documentation Retrieves an invoice by its external invoice ID. Requires the `invoice:get` scope. ```APIDOC ## GET /invoices/externalinvoiceid/{externalInvoiceId} ### Description GET Invoice by externalInvoiceId. ### Method GET ### Endpoint /invoices/externalinvoiceid/{externalInvoiceId} ### Parameters #### Path Parameters - **externalInvoiceId** (string) - Required - The external invoice ID. #### Query Parameters - **scope** (string) - Required - `invoice:get` ### Response #### Success Response (200) - **invoice** (object) - Description of the invoice #### Response Example ```json { "invoice": { "invoiceId": "inv_xyz", "externalInvoiceId": "ext_inv_123" } } ``` ``` -------------------------------- ### Retrieve All Customers Source: https://poswithlogic.dev/api/customers Use this endpoint to get a paginated list of customers. Supports incremental syncing with the `lastMod` parameter. Requires the `all` access level. ```shell curl --request GET \ --url https://api.poswithlogic.dev/customers \ --header 'x-api-key: ' ``` -------------------------------- ### GET /invoices/external/{externalOrderId} Source: https://poswithlogic.dev/documentation Retrieves an invoice by its external order ID (legacy). Requires the `invoice:get` scope. ```APIDOC ## GET /invoices/external/{externalOrderId} ### Description GET Invoice by external (legacy). ### Method GET ### Endpoint /invoices/external/{externalOrderId} ### Parameters #### Path Parameters - **externalOrderId** (string) - Required - The external order ID. #### Query Parameters - **scope** (string) - Required - `invoice:get` ### Response #### Success Response (200) - **invoice** (object) - Description of the invoice #### Response Example ```json { "invoice": { "invoiceId": "inv_xyz", "orderId": "order_abc" } } ``` ``` -------------------------------- ### Get Product by Code Source: https://poswithlogic.dev/documentation Retrieve a specific product's details using its SKU or item code. This is useful for fetching information about a single product when its code is known. ```curl curl -X GET https://api.poswithlogic.dev/products/code/PROD001 \ -H "x-api-key: YOUR_API_KEY" ``` -------------------------------- ### GET /customers/id/{id}/balance Source: https://poswithlogic.dev/documentation Retrieves a customer's balance by their ID. Requires the `customerbalance:get` scope. ```APIDOC ## GET /customers/id/{id}/balance ### Description GET Customer balance by ID. ### Method GET ### Endpoint /customers/id/{id}/balance ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the customer. #### Query Parameters - **scope** (string) - Required - `customerbalance:get` ### Response #### Success Response (200) - **balance** (number) - The customer's balance. #### Response Example ```json { "balance": 100.50 } ``` ``` -------------------------------- ### Include API Key in Header Source: https://poswithlogic.dev/api-keys Include your API key in the `x-api-key` header when making requests to the PosWithLogic API. ```bash curl "https://api.poswithlogic.dev/products" \ -H "x-api-key: YOUR_API_KEY" ``` -------------------------------- ### GET /customers/id/{customerId}/cards Source: https://poswithlogic.dev/documentation Retrieves a customer's credit cards. Requires the `customercard:get` scope. ```APIDOC ## GET /customers/id/{customerId}/cards ### Description Get customer credit cards. ### Method GET ### Endpoint /customers/id/{customerId}/cards ### Parameters #### Path Parameters - **customerId** (string) - Required - The ID of the customer. #### Query Parameters - **scope** (string) - Required - `customercard:get` ### Response #### Success Response (200) - **cards** (array) - Description of customer credit cards #### Response Example ```json { "cards": [ { "cardId": "card_123", "last4": "1234", "brand": "Visa" } ] } ``` ``` -------------------------------- ### GET /customers/phonenumber/{phoneNumber}/id Source: https://poswithlogic.dev/documentation Retrieves a customer's ID by their phone number. Requires the `customerid:get` scope. ```APIDOC ## GET /customers/phonenumber/{phoneNumber}/id ### Description GET Customer ID by phone number. ### Method GET ### Endpoint /customers/phonenumber/{phoneNumber}/id ### Parameters #### Path Parameters - **phoneNumber** (string) - Required - The phone number of the customer. #### Query Parameters - **scope** (string) - Required - `customerid:get` ### Response #### Success Response (200) - **customerId** (string) - The ID of the customer. #### Response Example ```json { "customerId": "cust_123" } ``` ``` -------------------------------- ### GET /customers/phonenumber/{phoneNumber}/balance Source: https://poswithlogic.dev/documentation Retrieves a customer's balance by their phone number. Requires the `customerbalance:get` scope. ```APIDOC ## GET /customers/phonenumber/{phoneNumber}/balance ### Description GET Customer balance by phone. ### Method GET ### Endpoint /customers/phonenumber/{phoneNumber}/balance ### Parameters #### Path Parameters - **phoneNumber** (string) - Required - The phone number of the customer. #### Query Parameters - **scope** (string) - Required - `customerbalance:get` ### Response #### Success Response (200) - **balance** (number) - The customer's balance. #### Response Example ```json { "balance": 100.50 } ``` ```