Platform API Endpoint: Search Organisation Customer Account Records
Within the SQUIZZ.com Application Programming Interface (API) it contains an endpoint that allows one organisation using 3rd party software to search for transactional customer account record data from another connected organisation's business system in real time. This is typically used by customer/purchasing organisations to search through lists of invoices, sales orders, transactions, payments or credit records directly linked to a customer account of a supplying organisation, based on trading activity that has occurred against a customer account. This end point allows record searches to be made, filtering by date range, record type, search word, and outstanding records.
To use the API endpoint you will need to have knowledge in building software applications, and how to make requests over the internet to call RESTful web services, that the platform's API endpoint is based on. It also helps having basic business knowledge in commerce and trading.
Topics |
Prerequisites
Before reading on please ensure that you have understood the following topics:
Overview
The SQUIZZ.com platform's API has an endpoint that allows an organisation to search for records within another connected organisation's business system, based on records associated to an assigned customer account. This may also be known as "Customer Account Enquiry". This endpoint allows an organisation to search for invoice, sales order, back order, transactions. credit and payment records, retrieved in realtime from a supplier organisation's connected business system. The records returned from endpoint are formatted as JSON data conforming to the "Ecommerce Standards Document" standards, with each document containing an array of zero or more records. The list of records found and returned is controlled by the supplying organisation's business system performing the search. This endpoint will return a list of records containing the overall details of each record. To retrieve the full details and any associated lines for each record call the Organisation Retrieve Customer Account Record API endpoint.
Notes
- A session must first be created in the API before calling the endpoint.
- The organisation calling the endpoint must be connected to the "supplying" organisation that is facilitating the record searching.
- The organisation calling the endpoint must be assigned to a customer account by the supplying organisation.
- A maximum of 100 search requests can be made against a supplying organisation within the last 15 minutes. This ensures the supplying organisation is not flooded with too many requests.
- It's recommended that the supplying organisation's returning the records may be sorting the records by the "most recent date created" by default. However some organisation systems may not be able to sort this way, with records appearing with no specific sorting.
- The supplying organisation being called to perform the record search must have enough trading tokens to allow the searches to occur, as outlined in the Trading Tokens and Pricing document.
- The supplying organisation being called to the perform the record search must have set up an integration with their own business system(s) to SQUIZZ.com, containing the customer account record data. This system must support receiving requests made by the SQUIZZ.com platform, as outlined in the Outgoing Request: Get Customer Account Enquiry Records endpoint. The SQUIZZ.com Connector software can be used by the supplying organisation to facilitate searching in their own business system. if the system does not provide its own web service or support the Ecommece Standards Documents standard.
HTTP Method | GET | |
HTTP URL | https://api.squizz.com/rest/1/org/search_customer_account_records_esd/session_id |
|
Headers | Data Type | Mandatory |
---|---|---|
Content-Type | STRING | Yes |
application/json | ||
Parameters | Data Type | Mandatory |
session_id | STRING | Yes |
ID of the API session. Place the session ID within the URL | ||
supplier_org_id | STRING | Yes |
ID of the organisation on the SQUIZZ.com platform to obtain records from. | ||
customer_account_code | STRING | Yes |
Code of the supplying organisation's customer account that records are associated to. The organisation calling this API endpoint must be assigned to this customer account by the supplying organisation. | ||
record_type | STRING | Yes |
Type of records to obtain. Set to one of the following:
|
||
begin_date_time | LONG | No |
Datetime to obtain records from. Datetime is set as milliseconds since the 01-01-1970 UTC epoch. If not set then it will default to 90 days before the current date and time. Ensure this date time occurs before the end_date_time parameter's value. | ||
end_date_time | LONG | No |
Datetime to obtain records to. Datetime is set as milliseconds since the 01-01-1970 UTC epoch. If not set then it will default to to the current date and time. | ||
pageNumber | INTEGER | No |
The page number to display records on. By default it is set to page 1. | ||
records_max_amount | INTEGER | No |
Number of records to display per page. By default it is set to 100 | ||
outstanding_records | ENUM(true,false) | No |
If true then only obtain records that are outstanding or unpaid. Ignore if not given or empty. Typically only set to true when retrieving invoice records and wish to obtain invoices that are outstanding, not fully paid, or overdue. | ||
key_record_ids | STRING | No |
Comma delimited list of records to find based on each record's keyRecordID. Ignore if not given or empty. | ||
search_string | STRING | No |
Text used to search and match record data on. The field to search on is based on the search type given. If no value has been given against the search_type parameter then the records may be searched against the default field that the supplying business system wishes to use. Typically this would be the record's number or code, such as invoiceNumber, salesOrderNumber, paymentNumber etc... But this may vary between systems. | ||
search_type | STRING | No |
The field within the records to search and match the search string on. Ignored if not given or empty. Note that not all record fields are supported by the supplying organisation systems to search on. This may vary per business system. The common search fields are: |
HTTP Response
Response Data Type | JSON |
Response Body | Returns serialized JSON of a ESDocumentCustomerAccountEnquiry document containing a list of customer account records for the given record type. |
Parameters | Data Type |
---|---|
resultStatus | INTEGER |
If 1 then denotes a successful response has been returned. 0 or more records may have been found. If not 1 then indicates an error has occurred when trying to perform the search. | |
configs.result_code | ENUM (SUCCESS or FAILURE) |
Either "SUCCESS" or "FAILURE". If successful then the data was imported into the platform against the organsiation. | |
configs.api_version | DECIMAL |
Version of the SQUIZZ.com platform's API used to handle the request | |
configs.result_code | STRING |
Status code of trying to search for the customer account record data. The following codes could be returned:
|
|
configs.search_wait_period | STRING |
Amount of minutes that the organisation calling this endpoint needs to wait before being able to perform a search again. This is only relevant if the result is a failure. | |
invoiceRecords | JSON ARRAY |
List of Customer Account Enquiry Invoice Records Each record contains limited overall details about each invoice record found. It will be set to null unless the record_type request parameter is set to INVOICE. | |
transactionRecords | JSON ARRAY |
List of Customer Account Enquiry Transaction Records Each record contains limited overall details about each transaction record found. It will be set to null unless the record_type request parameter is set to TRANSACTION. | |
orderSaleRecords | JSON ARRAY |
List of Customer Account Enquiry Sales Order Records Each record contains limited overall details about each sales order record found. It will be set to null unless the record_type request parameter is set to ORDER_SALE. | |
backOrderRecords | JSON ARRAY |
List of Customer Account Enquiry Back Order Records Each record contains limited overall details about each back order record found. It will be set to null unless the record_type request parameter is set to BACKORDER. | |
creditRecords | JSON ARRAY |
List of Customer Account Enquiry Credit Records Each record contains limited overall details about each credit record found. It will be set to null unless the record_type request parameter is set to CREDIT. | |
paymentRecords | JSON ARRAY |
List of Customer Account Enquiry Payment Records Each record contains limited overall details about each payment record found.It will be set to null unless the record_type request parameter is set to PAYMENT. |
Native Coding Library Examples:
HTTP Response Example:
"resultStatus": 1,
"version":1.3,
"message": "",
"configs":{
"api_version":"1.0.0.0",
"result_status": "SUCCESS",
"result_code":"SERVER_SUCCESS",
"dataFields":"[csv_list_of_data_fields]"
},
"invoiceRecords":[list_containing_found_invoice_records],
"orderSaleRecords":[list_containing_found_sales_order_records],
"backOrderRecords":[list_containing_found_back_order_records],
"creditRecords":[list_containing_found_credit_records],
"paymentRecords":[list_containing_found_payment_records],
}
Search Invoice Customer Account Records
The Search Organisation Customer Account Records API endpoint can be called by one organisation to search for a list of invoice records from within another connected organisation's business system, where the invoice records are associated with a specified customer account of the supplying organisation.
The endpoint will return a list of Customer Account Enquiry Invoice records in the Customer Account Enquiry Ecommerce Standards Document (ESD) JSON data format that the retrieving organisation has been given access to, based on the customer account that the supplying organisation has assigned to the retreiving organisation.
Within the retrieved Customer Account Enquiry JSON document, each invoice record is conforms to the Customer Account Enquiry Invoice ESD Record format.
Native Coding Library Examples:
HTTP Request Raw Example:
GET https://api.squizz.com/rest/1/org/search_customer_account_records_esd/3042EXAMPLEGSESSIONID342?supplier_org_id=1302EXAMPLEORGID&customer_account_code=ACCEG002&record_type=INVOICE&begin_date_time=1702818000000&end_date_time=1705511759983 HTTP/1.1
Host: api.squizz.com
Content-Type: application/json
HTTP Response Example:
Below is an example Customer Account Enquiry Invoice Document returned by the API endpoint.
"version": 1.4,
"resultStatus": 1,
"message":"The customer account enquiry invoice data has been successfully obtained.",
"dataTransferMode": "COMPLETE",
"totalDataRecords": 2,
"configs":{
"api_version": "1.0.0.0",
"result_code": "SERVER_SUCCESS",
"search_wait_period": 15
},
"invoiceRecords":
[
{
"keyInvoiceID":"111",
"invoiceID":"INVOICE-111",
"keyCustomerAccountID":"222",
"customerAccountCode":"CUST004",
"totalExTax": 100.00,
"totalIncTax": 110.00,
"totalTax": 10.00,
"totalPaid": 110.00,
"balance": 0
},
{
"keyInvoiceID":"112",
"invoiceID":"INVOICE-112",
"keyCustomerAccountID":"222",
"customerAccountCode":"CUST004",
"invoiceNumber": "1234123",
"creationDate": 1449132083084,
"invoiceDate": 1449932083084,
"dueDate": 1449932083084,
"expectedDeliveryDate": 1449982083084,
"deliveredDate": 1449982083084,
"keyLocationID": "456",
"locationCode": "LCT-456",
"locationLabel": "Warehouse",
"locationType": "WAREHOUSE",
"referenceKeyID": "ORDER-123",
"referenceType": "ORDER",
"referenceNumber": "123-1234123",
"customerReference": "PO-12345",
"salesRepCode": "JD",
"salesRepName": "John Doe",
"deliveryContact": "Lee",
"deliveryOrgName": "Lee's Business Pty Ltd",
"billingContact": "Tom",
"billingOrgName": "Lee's Business Pty Ltd",
"taxNumber": "123 12332 123",
"taxLabel": "GST",
"taxRate": 10,
"totalExTax": 100.00,
"totalIncTax": 110.00,
"totalTax": 10.00,
"totalFreightIncTax": 11.00,
"totalFreightExTax": 10.00,
"totalExtraChargesIncTax": 1.10,
"totalExtraChargesExTax": 1.00,
"totalDiscountsIncTax": 220.00,
"totalDiscountsExTax": 22.00,
"totalLeviesIncTax": 22.00,
"totalLeviesExTax": 20.00,
"totalPaid": 50.00,
"balance": 60.00,
"currencyCode": "AUD",
"totalQuantity": 3,
"description": "",
"language": "EN_AU"
}
]
}
Search Transaction Customer Account Records
The Search Organisation Customer Account Records API endpoint can be called by one organisation to search for a list of transaction records from within another connected organisation's business system, where the transaction records are associated with a specified customer account of the supplying organisation. Each transaction record defines the change in the customer account's balance, based on the type of transaction that has occurred. It may also indicate the type of record that is optionally linked to each transaction. The is the equivalance of looking at a bank statement to see the debits and credits made to a customer.
The endpoint will return a list of Customer Account Enquiry Transaction records in the Customer Account Enquiry Ecommerce Standards Document (ESD) JSON data format that the retrieving organisation has been given access to, based on the customer account that the supplying organisation has assigned to the retreiving organisation.
Within the retrieved Customer Account Enquiry JSON document, each transaction record conforms to the Customer Account Enquiry Transaction ESD Record format.
Native Coding Library Examples:
Search Sales Order Customer Account Records
The Search Organisation Customer Account Records API endpoint can be called by one organisation to search for a list of sales order records from within another connected organisation's business system, where the sales order records are associated with a specified customer account of the supplying organisation. Each sales order record defines a sale made against the customer account, for one or more quantities of goods and services. The sale may, or may not have yet be converted into an invoice, with the sales order representing an intention by a customer to make a transaction.
The endpoint will return a list of Customer Account Enquiry Sales Order records in the Customer Account Enquiry Ecommerce Standards Document (ESD) JSON data format that the retrieving organisation has been given access to, based on the customer account that the supplying organisation has assigned to the retreiving organisation.
Within the retrieved Customer Account Enquiry JSON document, each sales order record conforms to the Customer Account Enquiry Order Sale ESD Record format.
Native Coding Library Examples:
Search Back Order Customer Account Records
The Search Organisation Customer Account Records API endpoint can be called by one organisation to search for a list of back order records from within another connected organisation's business system, where the back order records are associated with a specified customer account of the supplying organisation. Each back order record outlines where the supplying organisation has not had the goods or services available that a customer had purchased, and the supplier has had to order the goods or services from their own supplier. Typically back orders are associated to a sales order or invoice record. Once a supplying organisation has received the goods and services it typically allows the back order to be closed, allowing corresponding sales orders or invoices to be completed.
The endpoint will return a list of Customer Account Enquiry Back Order records in the Customer Account Enquiry Ecommerce Standards Document (ESD) JSON data format that the retrieving organisation has been given access to, based on the customer account that the supplying organisation has assigned to the retreiving organisation.
Within the retrieved Customer Account Enquiry JSON document, each back order record conforms to the Customer Account Enquiry Back Order ESD Record format
Native Coding Library Examples:
Search Credit Customer Account Records
The Search Organisation Customer Account Records API endpoint can be called by one organisation to search for a list of credit records from within another connected organisation's business system, where the credit records are associated with a specified customer account of the supplying organisation. Each credit record defines a monetary amount that has been credited back to a customer, that may occur if a customer has been over charged, returned goods or services, or cancelled a sales order or invoice that wsa previously paid for.
The endpoint will return a list of Customer Account Enquiry Credit records in the Customer Account Enquiry Ecommerce Standards Document (ESD) JSON data format that the retrieving organisation has been given access to, based on the customer account that the supplying organisation has assigned to the retreiving organisation.
Within the retrieved Customer Account Enquiry JSON document, each credit record conforms to the Customer Account Enquiry Credit ESD Record format.
Native Coding Library Examples:
Search Payment Customer Account Records
The Search Organisation Customer Account Records API endpoint can be called by one organisation to search for a list of payment records from within another connected organisation's business system, where the payment records are associated with a specified customer account of the supplying organisation. Each payment record defines a monetary amount that has been paid by a customer against the customer account. A payment record may have been applied against one or more invoices, or sales orders, and provides a credit against the customer account balance.
The endpoint will return a list of Customer Account Enquiry Payment records in the Customer Account Enquiry Ecommerce Standards Document (ESD) JSON data format that the retrieving organisation has been given access to, based on the customer account that the supplying organisation has assigned to the retreiving organisation.
Within the retrieved Customer Account Enquiry JSON document, each payment record conforms to the Customer Account Enquiry Payment ESD Record format.