### Python Example Source: https://docs.ordermentum.io/reference/get_v2-products-retailerid-directory-featured A Python example using the 'requests' library to fetch featured products. Ensure you have the 'requests' library installed and replace {retailerId} and YOUR_API_KEY. ```python import requests retailer_id = '{retailerId}' api_key = 'YOUR_API_KEY' url = f"https://app.ordermentum.com/v2/products/{retailer_id}/directory/featured" headers = { 'Authorization': f'Bearer {api_key}' } params = { 'pageSize': 25, 'pageNo': 1 } response = requests.get(url, headers=headers, params=params) if response.status_code == 200: print(response.json()) else: print(f"Error: {response.status_code} - {response.text}") ``` -------------------------------- ### List Orders (Python) Source: https://docs.ordermentum.io/reference/get_v2-orders Example of how to list orders using Python with the 'requests' library. Ensure you have requests installed (`pip install requests`). ```python import requests url = "https://app.ordermentum.com/v2/orders" params = { "pageSize": 25, "pageNo": 1 } headers = { "Authorization": "Bearer YOUR_API_TOKEN" } response = requests.get(url, params=params, headers=headers) print(response.json()) ``` -------------------------------- ### Node.js Example Source: https://docs.ordermentum.io/reference/get_v2-products-retailerid-directory-featured This Node.js snippet demonstrates how to fetch featured products using the 'axios' library. Ensure you have axios installed and replace {retailerId} and YOUR_API_KEY. ```javascript const axios = require('axios'); const retailerId = '{retailerId}'; const apiKey = 'YOUR_API_KEY'; axios.get(`https://app.ordermentum.com/v2/products/${retailerId}/directory/featured`, { headers: { 'Authorization': `Bearer ${apiKey}` }, params: { pageSize: 25, pageNo: 1 } }) .then(response => { console.log(response.data); }) .catch(error => { console.error('Error fetching featured products:', error); }); ``` -------------------------------- ### List Orders (Node.js) Source: https://docs.ordermentum.io/reference/get_v2-orders Example of how to list orders using Node.js with the 'axios' library. Ensure you have axios installed (`npm install axios`). ```javascript const axios = require('axios'); const options = { method: 'GET', url: 'https://app.ordermentum.com/v2/orders', params: { pageSize: '25', pageNo: '1' }, headers: { Authorization: 'Bearer YOUR_API_TOKEN' } }; axios.request(options).then(function (response) { console.log(response.data); }).catch(function (error) { console.error(error); }); ``` -------------------------------- ### List Invoices - PHP Example Source: https://docs.ordermentum.io/reference/get_v2-invoices A PHP example demonstrating how to retrieve a list of invoices. It uses cURL to send the GET request. ```php "https://app.ordermentum.com/v2/invoices?pageSize=25&pageNo=1", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer YOUR_API_TOKEN" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:". $err; } else { echo $response; } ``` -------------------------------- ### PHP Example Source: https://docs.ordermentum.io/reference/get_v2-products-retailerid-directory Example of how to call the API using PHP. ```php ``` -------------------------------- ### Ruby Example Source: https://docs.ordermentum.io/reference/get_v2-products-retailerid-directory Example of how to call the API using Ruby. ```ruby require 'httparty' retailer_id = 'YOUR_RETAILER_ID' # Replace with the actual retailer ID access_token = 'YOUR_ACCESS_TOKEN' # Replace with your access token response = HTTParty.get( "https://app.ordermentum.com/v2/products/#{retailer_id}/directory", headers: { 'Authorization' => "Bearer #{access_token}" }, query: { pageSize: 25, pageNo: 1, search: 'Product Name' # Replace with your search query } ) puts response.body ``` -------------------------------- ### Python Example Source: https://docs.ordermentum.io/reference/get_v2-products-retailerid-directory Example of how to call the API using Python. ```python import requests retailer_id = 'YOUR_RETAILER_ID' # Replace with the actual retailer ID access_token = 'YOUR_ACCESS_TOKEN' # Replace with your access token url = f"https://app.ordermentum.com/v2/products/{retailer_id}/directory" headers = { 'Authorization': f'Bearer {access_token}' } params = { 'pageSize': 25, 'pageNo': 1, 'search': 'Product Name' # Replace with your search query } response = requests.get(url, headers=headers, params=params) if response.status_code == 200: print(response.json()) else: print(f"Error: {response.status_code} - {response.text}") ``` -------------------------------- ### Show Order by ID - Node.js Example Source: https://docs.ordermentum.io/reference/get_v2-orders-id Shows how to fetch an order by its ID using Node.js. Ensure you have the necessary libraries installed and replace {id} with the order ID. ```javascript const axios = require('axios'); const orderId = '{id}'; // Replace with the actual order ID const accessToken = 'YOUR_ACCESS_TOKEN'; // Replace with your access token axios.get(`https://app.ordermentum.com/v2/orders/${orderId}`, { headers: { 'Authorization': `Bearer ${accessToken}` } }) .then(response => { console.log('Order details:', response.data); }) .catch(error => { console.error('Error fetching order:', error); }); ``` -------------------------------- ### PHP Example Source: https://docs.ordermentum.io/reference/get_v2-products-retailerid-directory-featured This PHP snippet shows how to make a GET request to the featured products endpoint using Guzzle. Remember to replace {retailerId} and YOUR_API_KEY. ```php request('GET', "https://app.ordermentum.com/v2/products/{$retailerId}/directory/featured", [ 'headers' => [ 'Authorization' => "Bearer {$apiKey}" ], 'query' => [ 'pageSize' => 25, 'pageNo' => 1 ] ]); echo $response->getBody(); } catch ( GuzzleHttp\Exception\ClientException $e { echo 'Error: ' . $e->getMessage(); } ?> ``` -------------------------------- ### List Orders (PHP) Source: https://docs.ordermentum.io/reference/get_v2-orders Example of how to list orders using PHP with Guzzle. Ensure you have Guzzle installed via Composer (`composer require guzzlehttp/guzzle`). ```php request('GET', 'https://app.ordermentum.com/v2/orders', [ 'query' => [ 'pageSize' => 25, 'pageNo' => 1, ], 'headers' => [ 'Authorization' => 'Bearer YOUR_API_TOKEN', ] ]); echo $response->getBody(); } catch ( GuzzleHttp\Exception\BadResponseException $e ) { echo $e->getMessage(); } ?> ``` -------------------------------- ### Show Order by ID - PHP Example Source: https://docs.ordermentum.io/reference/get_v2-orders-id Illustrates how to get an order by its ID using PHP. Remember to substitute {id} with the correct order ID and provide your access token. ```php ``` -------------------------------- ### Node.js Example Source: https://docs.ordermentum.io/reference/get_v2-products-retailerid-directory Example of how to call the API using Node.js. ```javascript const axios = require('axios'); const retailerId = 'YOUR_RETAILER_ID'; // Replace with the actual retailer ID const accessToken = 'YOUR_ACCESS_TOKEN'; // Replace with your access token axios.get(`https://app.ordermentum.com/v2/products/${retailerId}/directory`, { headers: { 'Authorization': `Bearer ${accessToken}` }, params: { pageSize: 25, pageNo: 1, search: 'Product Name' // Replace with your search query } }) .then(response => { console.log(response.data); }) .catch(error => { console.error('Error fetching products:', error); }); ``` -------------------------------- ### Ruby Example Source: https://docs.ordermentum.io/reference/get_v2-products-retailerid-directory-featured A Ruby example using the 'httparty' gem to retrieve featured products. Replace {retailerId} and YOUR_API_KEY with your specific values. ```ruby require 'httparty' retailer_id = '{retailerId}' api_key = 'YOUR_API_KEY' response = HTTParty.get("https://app.ordermentum.com/v2/products/#{retailer_id}/directory/featured", headers: { 'Authorization' => "Bearer #{api_key}" }, query: { pageSize: 25, pageNo: 1 } ) puts response.body ``` -------------------------------- ### List Invoices - Shell Example Source: https://docs.ordermentum.io/reference/get_v2-invoices Demonstrates how to list invoices using a shell command. Ensure you have the correct bearer token for authentication. ```shell curl -X GET \ 'https://app.ordermentum.com/v2/invoices?pageSize=25&pageNo=1' \ -H 'Authorization: Bearer YOUR_API_TOKEN' ``` -------------------------------- ### Shell Example Source: https://docs.ordermentum.io/reference/get_v2-products-retailerid-directory-featured Use this snippet to make a GET request to the featured products endpoint using cURL. Replace {retailerId} with the actual retailer ID. ```Shell curl -X GET \ 'https://app.ordermentum.com/v2/products/{retailerId}/directory/featured?pageSize=25&pageNo=1' \ -H 'Authorization: Bearer YOUR_API_KEY' ``` -------------------------------- ### Shell Example Source: https://docs.ordermentum.io/reference/get_v2-products-retailerid-directory Example of how to call the API using curl in a shell environment. ```shell curl -X GET \ 'https://app.ordermentum.com/v2/products/{retailerId}/directory?pageSize=25&pageNo=1&search=Product%20Name' \ -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' ``` -------------------------------- ### Show Order by ID - Ruby Example Source: https://docs.ordermentum.io/reference/get_v2-orders-id Provides a Ruby example for retrieving an order by its ID. You will need to replace {id} with the specific order ID and use your access token. ```ruby require 'httparty' order_id = '{id}' # Replace with the actual order ID access_token = 'YOUR_ACCESS_TOKEN' # Replace with your access token response = HTTParty.get("https://app.ordermentum.com/v2/orders/#{order_id}", headers: { 'Authorization' => "Bearer #{access_token}" }) if response.success? puts "Order details: #{response.parsed_response}" else puts "Error fetching order: #{response.code} - #{response.message}" end ``` -------------------------------- ### List Invoices - Node.js Example Source: https://docs.ordermentum.io/reference/get_v2-invoices Shows how to fetch a list of invoices using Node.js. This example uses the 'axios' library for making HTTP requests. ```javascript const axios = require('axios'); const options = { method: 'GET', url: 'https://app.ordermentum.com/v2/invoices', params: { pageSize: '25', pageNo: '1' }, headers: { Authorization: 'Bearer YOUR_API_TOKEN' } }; axios.request(options).then(function (response) { console.log(response.data); }).catch(function (error) { console.error(error); }); ``` -------------------------------- ### Make Authenticated API Request Source: https://docs.ordermentum.io/docs/getting-started-with-ordermentum-api-authentication-and-first-steps Include the obtained Bearer Token in the 'Authorization' header for all subsequent API requests. This example shows how to fetch orders using a GET request. ```bash curl -X GET "https://api.ordermentum.com/v2/orders" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### Show Order by ID - Shell Example Source: https://docs.ordermentum.io/reference/get_v2-orders-id Demonstrates how to retrieve an order using its ID via a shell command. Replace {id} with the actual order ID. ```shell curl -X GET https://app.ordermentum.com/v2/orders/{id} -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### List Invoices - Ruby Example Source: https://docs.ordermentum.io/reference/get_v2-invoices Provides a Ruby example for listing invoices. This snippet utilizes the 'httparty' gem for HTTP requests. ```ruby require 'httparty' url = "https://app.ordermentum.com/v2/invoices" options = { query: { pageSize: 25, pageNo: 1 }, headers: { Authorization: "Bearer YOUR_API_TOKEN" } } response = HTTParty.get(url, options) puts response ``` -------------------------------- ### Get Product Details Source: https://docs.ordermentum.io/docs/managing-products-and-variants-in-ordermentum-api Retrieve full details for a specific product using its unique ID. ```bash curl -X GET "https://api.ordermentum.com/v1/products/34cd12ab-7890-efab-1234-567890abcdef" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### List Orders (Shell) Source: https://docs.ordermentum.io/reference/get_v2-orders Example of how to list orders using cURL. This is a basic request to the orders endpoint. ```shell curl -X GET \ 'https://app.ordermentum.com/v2/orders?pageSize=25&pageNo=1' \ -H 'Authorization: Bearer YOUR_API_TOKEN' ``` -------------------------------- ### cURL Request Example Source: https://docs.ordermentum.io/reference/post_v2-products-retailerid-search This snippet shows a cURL command to search for products. It includes the endpoint URL, required headers, and a sample JSON body for the request. ```Shell curl --request POST \ --url https://app.ordermentum.com/v2/products/retailerId/search \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data '{"visible":true}' ``` -------------------------------- ### List Orders (Ruby) Source: https://docs.ordermentum.io/reference/get_v2-orders Example of how to list orders using Ruby with the 'httparty' gem. Make sure to add `gem 'httparty'` to your Gemfile. ```ruby require 'httparty' url = 'https://app.ordermentum.com/v2/orders' options = { query: { pageSize: 25, pageNo: 1 }, headers: { 'Authorization' => 'Bearer YOUR_API_TOKEN' } } response = HTTParty.get(url, options) puts response ``` -------------------------------- ### Example Order Event Payload Source: https://docs.ordermentum.io/docs/registering-webhooks-for-order-events-1 This is an example JSON payload for an 'order_created' event. Your application will receive similar structures for subscribed events. ```json { "event": "order_created", "timestamp": "2023-07-26T12:34:56Z", "data": { "id": "17a36ca1-8835-4cf6-a95c-e42bb16d0ca9", "createdAt": "2023-07-26T07:59:36.912Z", "updatedAt": "2023-07-26T07:59:36.912Z", "total": 150.25 } } ``` -------------------------------- ### Get Variants for a Specific Product Source: https://docs.ordermentum.io/docs/managing-products-and-variants-in-ordermentum-api Retrieve all variants associated with a particular product by providing the product ID. ```bash curl -X GET "https://api.ordermentum.com/v1/products/34cd12ab-7890-efab-1234-567890abcdef/variants" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### List Invoices - Python Example Source: https://docs.ordermentum.io/reference/get_v2-invoices This Python snippet shows how to list invoices using the 'requests' library. Remember to replace 'YOUR_API_TOKEN' with your actual token. ```python import requests url = "https://app.ordermentum.com/v2/invoices" params = { "pageSize": 25, "pageNo": 1 } headers = { "Authorization": "Bearer YOUR_API_TOKEN" } response = requests.get(url, params=params, headers=headers) print(response.json()) ``` -------------------------------- ### Example Rate Limit Error Response Source: https://docs.ordermentum.io/docs/rate-limits-and-api-usage-guidelines This is an example of a 429 Too Many Requests response from the API, which includes a Retry-After header indicating the wait time before the next request. ```bash HTTP/1.1 429 Too Many Requests Content-Type: application/json Retry-After: 60 ``` -------------------------------- ### Show Order by ID - Python Example Source: https://docs.ordermentum.io/reference/get_v2-orders-id A Python script to fetch an order using its ID. Replace {id} with the target order's ID and ensure your access token is correctly set. ```python import requests order_id = '{id}' # Replace with the actual order ID access_token = 'YOUR_ACCESS_TOKEN' # Replace with your access token url = f"https://app.ordermentum.com/v2/orders/{order_id}" headers = { 'Authorization': f'Bearer {access_token}' } response = requests.get(url, headers=headers) if response.status_code == 200: print("Order details:", response.json()) else: print(f"Error fetching order: {response.status_code} - {response.text}") ``` -------------------------------- ### Get Products Directory Source: https://docs.ordermentum.io/reference/get_v2-products-retailerid-directory Retrieves a list of products from a retailer's directory based on search criteria and pagination. ```APIDOC ## GET /v2/products/{retailerId}/directory ### Description Searches for products in a global directory for a specific retailer. ### Method GET ### Endpoint https://app.ordermentum.com/v2/products/{retailerId}/directory ### Parameters #### Path Parameters - **retailerId** (uuid) - Required - Retailer id #### Query Parameters - **pageSize** (integer) - Optional - Defaults to 25. Must be greater than or equal to 1. - **pageNo** (integer) - Optional - Defaults to 1. Must be greater than or equal to 1. - **search** (string) - Required - Product name. Only valid when more than 1 character is passed. Length must be greater than or equal to 1. ### Responses #### Success Response (200) - **List of products** #### Error Responses - **400** - Invalid data - **403** - No access to retailer - **default** - Error message ``` -------------------------------- ### Get featured products from the global directory Source: https://docs.ordermentum.io/reference/get_v2-products-retailerid-directory-featured Fetches a paginated list of featured products for a specified retailer from the global directory. ```APIDOC ## GET /v2/products/{retailerId}/directory/featured ### Description Retrieves a list of featured products from the global directory for a specific retailer. ### Method GET ### Endpoint https://app.ordermentum.com/v2/products/{retailerId}/directory/featured ### Parameters #### Path Parameters - **retailerId** (uuid) - Required - Retailer id #### Query Parameters - **pageSize** (integer) - Optional - Defaults to 25. Must be greater than or equal to 1. - **pageNo** (integer) - Optional - Defaults to 1. Must be greater than or equal to 1. ### Responses #### Success Response (200) - **products** (List) - List of products #### Error Responses - **400** - Invalid data - **403** - No access to retailer - **default** - Error message ``` -------------------------------- ### Purchaser Details Response Source: https://docs.ordermentum.io/docs/managing-customers This is an example of the JSON response when retrieving detailed purchaser information. It includes contact, address, and pricing details. ```json { "id": "123e4567-e89b-12d3-a456-426614174000", "name": "Retailer One", "retailerAddress": { "street1": "123 Fake Street", "suburb": "Melbourne", "state": "VIC", "postcode": "3000", "country": "Australia" }, "priceGroup": { "id": "456e7890-e12a-34bc-d456-789012340000", "name": "Wholesale Tier 1" }, "visibilityTags": ["default", "seasonal"], "paymentMethodTypes": { "value": ["card", "direct"], "display": "Credit / Debit Card, Direct Debit" } } ``` -------------------------------- ### Get Product Details Source: https://docs.ordermentum.io/docs/managing-products-and-variants-in-ordermentum-api Retrieve full details of a specific product, including its attributes, categories, and associated variants. ```APIDOC ## GET /v1/products/{productId} ### Description Retrieve full details of a specific product, including attributes, categories, and variants. ### Method GET ### Endpoint /v1/products/{productId} #### Path Parameters - **productId** (string) - Required - The unique identifier of the product. ### Request Example ```bash curl -X GET "https://api.ordermentum.com/v1/products/34cd1234-abcd-efgh-1234-567890abcdef" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ``` -------------------------------- ### Get Variants for a Specific Product Source: https://docs.ordermentum.io/docs/managing-products-and-variants-in-ordermentum-api Retrieve all variants that are associated with a particular product. ```APIDOC ## GET /v1/products/{productId}/variants ### Description Retrieve all variants associated with a specific product. ### Method GET ### Endpoint /v1/products/{productId}/variants #### Path Parameters - **productId** (string) - Required - The unique identifier of the product. ### Request Example ```bash curl -X GET "https://api.ordermentum.com/v1/products/34cd1234-abcd-efgh-1234-567890abcdef/variants" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ``` -------------------------------- ### Get Details of a Specific Variant Source: https://docs.ordermentum.io/docs/managing-products-and-variants-in-ordermentum-api Retrieve detailed information for a specific product variant using both the product ID and variant ID. ```bash curl -X GET "https://api.ordermentum.com/v1/products/34cd12ab-7890-efab-1234-567890abcdef/variants/ef901234-ab56-7890-cd12-34567890abcd" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### Search Purchasers by Tag Source: https://docs.ordermentum.io/docs/managing-customers This example shows how to search for purchasers using a specific tag filter. The `tags` parameter supports various conditions like `__contains`. ```curl curl -X GET "https://api.ordermentum.com/v1/purchasers?tags%5B0%5D=class__contains%3Dretail" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### Create Invoice Response Example Source: https://docs.ordermentum.io/docs/managing-invoices This JSON response confirms the successful creation of an invoice. It returns the details of the newly created invoice, including its ID, number, status, and financial summary. ```json { "id": "789e0123-e45c-12d3-a456-426614174000", "number": "INV-20231001-001", "status": "Unpaid", "createdAt": "2023-10-01T12:34:56Z", "dueAt": "2023-10-15T00:00:00Z", "totalCost": 46.00, "totalFreight": 0.00, "surcharge": 0.00, "subtotal": 46.00, "totalGST": 0.00, "credit": 0.00, "total": 46.00, "lineItems": [ { "name": "Milk 2L Carton", "SKU": "123", "quantity": 2, "price": 23.00, "weight": 1.5, "taxable": true } ] } ``` -------------------------------- ### Summary Invoice Response Example Source: https://docs.ordermentum.io/docs/managing-invoices This JSON structure represents a paginated list of invoices, showing essential fields for each entry. It includes metadata for total results, page size, and current page number. ```json { "data": [ { "id": "789e0123-e45c-12d3-a456-426614174000", "number": "INV-20231001-001", "status": "Unpaid", "createdAt": "2023-10-01T12:34:56Z", "dueAt": "2023-10-15T00:00:00Z", "total": 616.00 }, { "id": "789e0123-e45c-12d3-a456-426614174001", "number": "INV-20231002-001", "status": "Paid", "createdAt": "2023-10-02T09:00:00Z", "dueAt": "2023-10-16T00:00:00Z", "total": 500.00 } ], "meta": { "totalResults": 100, "pageSize": 50, "pageNo": 1 } } ``` -------------------------------- ### Get Lead by ID Source: https://docs.ordermentum.io/docs/managing-leads Retrieve detailed information about a specific lead using its unique GUID. This endpoint provides nested details about the associated retailer, supplier, and connection request. ```APIDOC ## GET /v1/leads/{id} ### Description Retrieve detailed information about a specific lead using its unique GUID (Identified by a 36-character string). It provides nested details about the associated retailer, supplier, and connection request. ### Method GET ### Endpoint /v1/leads/{id} ### Parameters #### Path Parameters - **id** (string, required): The unique identifier of the lead (GUID format). ### Request Example ```bash curl -X GET "https://api.ordermentum.com/v1/leads/651bdbbe-5387-4741-bcb6-6e4ccceeb19c" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ### Response #### Success Response (200 OK) - **id** (string) - The unique identifier of the lead. - **status** (string) - The current status of the lead. - **chargeable** (boolean) - Indicates whether the lead is chargeable. - **isApproved** (boolean) - Indicates whether the lead has been approved. - **createdAt** (string) - The timestamp when the lead was created. - **connectionRequest** (object) - Contains details about the connection request. - **retailer** (object) - Provides details about the retailer associated with the lead. #### Response Example ```json { "id": "651bdbbe-5387-4741-bcb6-6e4ccceeb19c", "status": "unprocessed", "chargeable": false, "isApproved": false, "isRejected": false, "isActivated": false, "parsedStatus": "Unprocessed", "retailerId": "fb85475b-1d8e-45d0-99e1-ee935e4d0df3", "supplierId": "4fe760f3-e7f8-4044-bc42-fcbb8cf4e610", "connectionRequestId": "a4177710-5661-4089-9df1-afddf5483ff7", "actionedBy": "de940c29-bd91-46c5-9176-dffd09813703", "actionedByUser": "John Doe", "actionedAt": null, "responses": {}, "updatedAt": "2023-12-06T23:08:30.625Z", "createdAt": "2023-12-06T23:08:30.625Z", "assignedUserId": null, "expiresAt": null, "assignedUser": "", "connectionRequest": { "id": "a4177710-5661-4089-9df1-afddf5483ff7", "createdBy": { "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "phone": "0458253698" }, "status": "Request sent", "supplier": { "tradingName": "Example Supplier" }, "retailer": { "tradingName": "Example Retailer", "address": { "formatted": "123 Main St, Sydney NSW 2000, Australia" }, "phone": "0298765432" }, "isApproved": true, "isRejected": false, "chargeable": null, "createdAt": "2023-12-06T23:08:30.583Z", "updatedAt": "2023-12-06T23:08:30.598Z" }, "retailer": { "id": "fb85475b-1d8e-45d0-99e1-ee935e4d0df3", "name": "Example Retailer", "legalName": "Example Retailer Pty Ltd", "tradingName": "Example Retailer", "email": "info@example-retailer.com", "phone": "0298765432", "address": { "formatted": "123 Main St, Sydney NSW 2000, Australia" } }, "purchaserId": null, "purchaser": null, "parsedSource": "Ordermentum app", "supplierGrowthEngineActive": true, "inDeliveryArea": false, "profileId": "048edd6b-f5aa-494f-b848-1275a2e97271", "profileName": "Example Profile", "userId": "de940c29-bd91-46c5-9176-dffd09813703", "warning": true, "expired": false, "deletedAt": null, "creatorName": "John Doe", "creatorEmail": "john.doe@example.com", "customerPhone": "0298765432", "customerEmail": "info@example-retailer.com", "customerPostcode": "2000", "purchaserTrading": false } ``` ### Error Responses - 400 Bad Request: Invalid data provided (e.g., malformed ID). - 403 Forbidden: No access to the retailer associated with the lead. - Default: An error message with details about the issue. ``` -------------------------------- ### Get Lead by ID Source: https://docs.ordermentum.io/docs/managing-leads Retrieve detailed information about a specific lead using its unique GUID. This endpoint provides nested details about the associated retailer, supplier, and connection request. ```APIDOC ## GET /v1/leads/{id} ### Description Retrieve detailed information about a specific lead using its unique GUID (Identified by a 36-character string). It provides nested details about the associated retailer, supplier, and connection request. ### Method GET ### Endpoint /v1/leads/{id} ### Parameters #### Path Parameters - **id** (string, required): The unique identifier of the lead (GUID format). ### Request Example ```bash curl -X GET "https://api.ordermentum.com/v1/leads/651bdbbe-5387-4741-bcb6-6e4ccceeb19c" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ### Response #### Success Response (200 OK) - **id** (string) - The unique identifier of the lead. - **status** (string) - The current status of the lead (e.g., unprocessed). - **chargeable** (boolean) - Indicates whether the lead is chargeable. - **isApproved** (boolean) - Indicates whether the lead has been approved. - **createdAt** (string) - The timestamp when the lead was created. - **connectionRequest** (object) - Contains details about the connection request, including the creator, supplier, and retailer information. - **retailer** (object) - Provides details about the retailer associated with the lead, including name, contact information, and address. #### Response Example ```json { "id": "651bdbbe-5387-4741-bcb6-6e4ccceeb19c", "status": "unprocessed", "chargeable": false, "isApproved": false, "isRejected": false, "isActivated": false, "parsedStatus": "Unprocessed", "retailerId": "fb85475b-1d8e-45d0-99e1-ee935e4d0df3", "supplierId": "4fe760f3-e7f8-4044-bc42-fcbb8cf4e610", "connectionRequestId": "a4177710-5661-4089-9df1-afddf5483ff7", "actionedBy": "de940c29-bd91-46c5-9176-dffd09813703", "actionedByUser": "John Doe", "actionedAt": null, "responses": {}, "updatedAt": "2023-12-06T23:08:30.625Z", "createdAt": "2023-12-06T23:08:30.625Z", "assignedUserId": null, "expiresAt": null, "assignedUser": "", "connectionRequest": { "id": "a4177710-5661-4089-9df1-afddf5483ff7", "createdBy": { "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "phone": "0458253698" }, "status": "Request sent", "supplier": { "tradingName": "Example Supplier" }, "retailer": { "tradingName": "Example Retailer", "address": { "formatted": "123 Main St, Sydney NSW 2000, Australia" }, "phone": "0298765432" }, "isApproved": true, "isRejected": false, "chargeable": null, "createdAt": "2023-12-06T23:08:30.583Z", "updatedAt": "2023-12-06T23:08:30.598Z" }, "retailer": { "id": "fb85475b-1d8e-45d0-99e1-ee935e4d0df3", "name": "Example Retailer", "legalName": "Example Retailer Pty Ltd", "tradingName": "Example Retailer", "email": "info@example-retailer.com", "phone": "0298765432", "address": { "formatted": "123 Main St, Sydney NSW 2000, Australia" } }, "purchaserId": null, "purchaser": null, "parsedSource": "Ordermentum app", "supplierGrowthEngineActive": true, "inDeliveryArea": false, "profileId": "048edd6b-f5aa-494f-b848-1275a2e97271", "profileName": "Example Profile", "userId": "de940c29-bd91-46c5-9176-dffd09813703", "warning": true, "expired": false, "deletedAt": null, "creatorName": "John Doe", "creatorEmail": "john.doe@example.com", "customerPhone": "0298765432", "customerEmail": "info@example-retailer.com", "customerPostcode": "2000", "purchaserTrading": false } ``` ### Error Responses - 400 Bad Request: Invalid data provided (e.g., malformed ID). - 403 Forbidden: No access to the retailer associated with the lead. - Default: An error message with details about the issue. ``` -------------------------------- ### Get Lead by ID Request Source: https://docs.ordermentum.io/docs/managing-leads Use this endpoint to retrieve detailed information about a specific lead using its unique GUID. Ensure you include your API token in the Authorization header. ```bash curl -X GET "https://api.ordermentum.com/v1/leads/651bdbbe-5387-4741-bcb6-6e4ccceeb19c" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### Create a New Order Source: https://docs.ordermentum.io/docs/managing-orders Create a new order using the POST /v1/orders endpoint. Ensure you have the necessary supplier, retailer, and product IDs, along with delivery details. ```bash curl -X POST "https://app.ordermentum.com/v1/orders" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ --data '{ \ "supplierId": "123e4567-e89b-12d3-a456-426614174000", \ "retailerId": "123e4567-e89b-12d3-a456-426614174001", \ "origin": "retailer", \ "deliveryDate": "2025-01-15T10:00:00Z", \ "lineItems": [ \ { \ "productId": "123e4567-e89b-12d3-a456-426614174002", \ "quantity": 5, \ "price": 10.00 \ } \ ] \ }' ``` -------------------------------- ### List All Product Variants Source: https://docs.ordermentum.io/docs/managing-products-and-variants-in-ordermentum-api Retrieve a comprehensive list of all product variants available in the system. Supports pagination. ```bash curl -X GET "https://api.ordermentum.com/v1/variants?pageSize=10" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### Create a Price Group Source: https://docs.ordermentum.io/docs/understanding-and-managing-price-groups Creates a new price group. Requires a name and status, with an optional description. ```bash curl -X POST "https://app.ordermentum.com/v1/price-groups" -H "Authorization: Bearer YOUR_API_TOKEN" -H "Content-Type: application/json" --data '{ "name": "Preferred Retailers", "description": "Exclusive pricing for top clients", "status": "active" }' ``` -------------------------------- ### Sample cURL Request for Listing Locations Source: https://docs.ordermentum.io/docs/stock-api-overview This cURL command demonstrates how to list all stock locations for a supplier. Ensure you include the Authorization and supplier context headers. ```bash curl -X GET "https://stock.ordermentum.com/v1/locations" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "context-entity: supplier" \ -H "context-id: 11111111-2222-3333-4444-555555555555" ``` -------------------------------- ### Retrieve Purchaser Details Source: https://docs.ordermentum.io/docs/managing-customers Use this endpoint to get all information about a specific purchaser. Ensure you have the correct purchaser ID. ```curl curl -X GET "https://api.ordermentum.com/v1/purchasers/123e4567-e89b-12d3-a456-426614174000" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### List Products with Filters Source: https://docs.ordermentum.io/docs/managing-products-and-variants-in-ordermentum-api Retrieve a summarized list of products. Supports filtering by search terms and pagination. ```bash curl -X GET "https://api.ordermentum.com/v2/products?search=tea&pageSize=10" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### Get Details of a Specific Variant Source: https://docs.ordermentum.io/docs/managing-products-and-variants-in-ordermentum-api Retrieve detailed information about a specific product variant using both the product ID and the variant ID. ```APIDOC ## GET /v1/products/{productId}/variants/{variantId} ### Description Retrieve detailed information about a specific variant, given the product ID and variant ID. ### Method GET ### Endpoint /v1/products/{productId}/variants/{variantId} #### Path Parameters - **productId** (string) - Required - The unique identifier of the product. - **variantId** (string) - Required - The unique identifier of the variant. ### Request Example ```bash curl -X GET "https://api.ordermentum.com/v1/products/34cd1234-abcd-efgh-1234-567890abcdef/variants/ef901234-abcd-efgh-1234-567890abcd" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ``` -------------------------------- ### Ordermentum API Token Response Source: https://docs.ordermentum.io/docs/getting-started-with-ordermentum-api-authentication-and-first-steps This is an example of the JSON response received after successfully obtaining an API token. The 'access_token' field contains your Bearer Token. ```json { "access_token": "YOUR_API_TOKEN", "token_type": "Bearer" } ``` -------------------------------- ### Create Order Source: https://docs.ordermentum.io/docs/managing-orders Creates a new order for a retailer. Requires supplier, retailer, delivery date, and line item details. ```APIDOC ## POST /v1/orders ### Description Creates a new order in the system. This endpoint requires detailed information about the supplier, retailer, delivery, and the specific products being ordered. ### Method POST ### Endpoint /v1/orders ### Parameters #### Request Body - **supplierId** (string) - Required - The unique identifier for the supplier. - **retailerId** (string) - Required - The unique identifier for the retailer. - **origin** (string) - Required - The origin of the order (e.g., 'retailer'). - **deliveryDate** (string) - Required - The desired delivery date and time in ISO 8601 format. - **lineItems** (array) - Required - An array of objects, where each object represents a product and its quantity. - **productId** (string) - Required - The unique identifier for the product. - **quantity** (integer) - Required - The quantity of the product to order. - **price** (number) - Required - The price per unit of the product. ### Request Example ```bash curl -X POST "https://app.ordermentum.com/v1/orders" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ --data '{ "supplierId": "123e4567-e89b-12d3-a456-426614174000", "retailerId": "123e4567-e89b-12d3-a456-426614174001", "origin": "retailer", "deliveryDate": "2025-01-15T10:00:00Z", "lineItems": [ { "productId": "123e4567-e89b-12d3-a456-426614174002", "quantity": 5, "price": 10.00 } ] }' ``` ``` -------------------------------- ### Get Invoice Summary Source: https://docs.ordermentum.io/docs/managing-invoices Retrieves a summary of invoices, allowing for searching and filtering based on various criteria. This endpoint is useful for bulk retrieval for analysis or reporting. ```APIDOC ## GET /v2/invoices ### Description Searches and filters multiple invoices, returning a summary of their status, totals, and timestamps. ### Method GET ### Endpoint /v2/invoices ### Parameters #### Query Parameters - **supplierId** (string) - Required - The ID of the supplier. - **pageSize** (integer) - Optional - The number of results to return per page. - **pageNo** (integer) - Optional - The page number to retrieve. ### Response #### Success Response (200) - **data** (array) - An array of invoice summary objects. - **id** (string) - The unique identifier for the invoice. - **number** (string) - The invoice number. - **status** (string) - The current status of the invoice (e.g., "Unpaid", "Paid"). - **createdAt** (string) - The timestamp when the invoice was created. - **dueAt** (string) - The timestamp when the invoice is due. - **total** (number) - The total amount of the invoice. - **meta** (object) - Metadata about the pagination. - **totalResults** (integer) - The total number of results available. - **pageSize** (integer) - The number of results per page. - **pageNo** (integer) - The current page number. ### Response Example ```json { "data": [ { "id": "789e0123-e45c-12d3-a456-426614174000", "number": "INV-20231001-001", "status": "Unpaid", "createdAt": "2023-10-01T12:34:56Z", "dueAt": "2023-10-15T00:00:00Z", "total": 616.00 } ], "meta": { "totalResults": 100, "pageSize": 50, "pageNo": 1 } } ``` ```