Documentation


API


Introduction

The Document Warehouse was created to serve as an adapter between stores and the Agiloft document management system. It is responsible for issuing invoices, tracking enrolments, and interfacing with Agiloft records.

For your conevenience a demo environment was created at warehousedemo.cca-acc.com which can be used to test interactions with the various API endpoints outlined here.

Before you can begin testing API calls, an outlet will need to be created for you within the warehouse demo environment. Please contact [email protected] with your desired outlet domain name to have one created for you. You will then be provided with an outlet access token which is required to make calls to the API.

When making any calls to the API you must provide an outlet to authenticate with. The outlet includes a domain and access token. Here is an example API call using a CURL command:

curl --request POST --url https://warehousestaging.cca-acc.com/api/v1/endpoint --header 'Content-Type: application/json' --data '{
"outlet": {
"access_token": "your_access_token_here",
"domain": "youroutletdomain.com"
}
}'

Outlet

The outlet endpoint simply returns details related to the currently authenticated outlet. This endpoint does not accept any query parameters as it should always return your outlet information exclusively.

Endpoint

https://warehousestaging.cca-acc.com/api/v1/outlet-info

Returns

{
"id": 1,
"short_name": "Outlet short name",
"full_name": "Outlet full name",
"domain": "youroutletdomain.com",
"store_url": "https://youroutletdomain.com/store/",
"color_primary": "#000000",
"color_secondary": "#ffffff",
"logo_url": "/api/v1/outlets/logo/yourlogo.png"
}

SKUs

The SKUs endpoint provides a method of retrieving official and up to date SignaSur™ SKUs with which you can populate your store.

Endpoint

https://warehousestaging.cca-acc.com/api/v1/skus

Returns

{
"skus": [
{
"id": 1,
"status": 0,
"name": "SKU name",
"short_description": "SKU short description",
"long_description": "SKU long description",
"provides_access": 1,
"requires_access": 0,
"lca_price": 5800,
"non_lca_price": 5800,
"image_url": "https://warehousestaging.cca-acc.com/product-images/access.png"
}, ...
]
}

Without providing parameters the JSON returned will contain all SKUs that exist in the warehouse. You can include URL parameters on the endpoint in order to filter by any of the SKU fields shown above. For example:

https://warehousestaging.cca-acc.com/api/v1/skus?status=1

This endpoint will only return active SKUs.

You can also retrieve a specific SKU by passing an ID:

https://warehousestaging.cca-acc.com/api/v1/skus?id=10

Customers

The customers endpoint provides a method of retrieving information related your outlets customers, such as contact information or enrolment status.

Endpoint

https://warehousestaging.cca-acc.com/api/v1/customers

Returns

{
"customers": [
{
"id": 1,
"first_name": "John",
"last_name": "Doe",
"email_address": "[email protected]",
"company_name": "SignaSur™",
"enrolment_type": "active",
"enrolment_end": "2025-01-01T04:00:00.000Z"
}, ...
]
}

Without providing parameters the JSON returned will contain all of your outlets customers that exist in the warehouse. You can include URL parameters on the endpoint in order to filter by any of the customer fields shown above. For example:

https://warehousestaging.cca-acc.com/api/v1/customers?enrolment_type=active

This endpoint will only return customers with an active enrolment.

You can also retrieve a specific customer by passing an ID or Email:

https://warehousestaging.cca-acc.com/api/v1/[email protected]

Transactions

The transactions endpoint provides a method of retrieving information related your store transactions that were sent to SignaSur™ using the Create Transaction endpoint.

Endpoint

https://warehousestaging.cca-acc.com/api/v1/transactions

Returns

{
"transactions": [
{
"id": 1,
"customer_id": 1,
"received_at": "2024-01-01T04:00:00.000Z",
"confirmed_at": "2024-01-01T04:00:00.000Z",
"line_items": [
{
"id": 1,
"sku_id": 1,
"quantity": 1
}, ...
]
}

Without providing parameters the JSON returned will contain all of your outlets transactions that exist in the warehouse. You can include URL parameters on the endpoint in order to filter by any of the transaction fields shown above. For example:

https://warehousestaging.cca-acc.com/api/v1/transactions?customer_id=1

This endpoint will only return transactions made by a particular customer.

You can also retrieve a specific transaction by passing an ID:

https://warehousestaging.cca-acc.com/api/v1/transactions?id=1

Additionally you can query for transactions that contain a specific SKU

https://warehousestaging.cca-acc.com/api/v1/transactions?sku_id=1

Create Transaction

The create transaction endpoint is used to send purchase information to SignaSur™. These transactions are used to determine customer enrollment and they are also used to trigger account creation and synchronization in Agiloft.

Endpoint

https://warehousestaging.cca-acc.com/api/v1/transaction

Transaction information must be sent in the body of your API calls. Below is an example API call using a CURL command:

curl --request POST --url https://warehousestaging.cca-acc.com/api/v1/transaction --header 'Content-Type: application/json' --data '{
"outlet": {
"access_token": "your_access_token_here",
"domain": "youroutletdomain.com"
},
"customer": {
"first_name": "John",
"last_name": "Doe",
"email_address": "[email protected]",
"company_name": "SignaSur™"
},
"order": {
"line_items": [
{
"sku_id": 1,
"sku": "DW-001",
"quantity": 1
}, ...
]
}
}'

Verify Enrolment

The verify enrolment endpoint returns information regarding whether or not a customer has an active enrolment. This endpoint can be used to implement purchasing rules on products in your store such as preventing inactive customers from purchasing SKUs.

Endpoint

https://warehousestaging.cca-acc.com/api/v1/verify-enrollment

To verify a customer simply pass their email address in the body of your API call. Here's an example using a CURL command:

curl --request POST --url https://warehousestaging.cca-acc.com/api/v1/verify-enrollment --header 'Content-Type: application/json' --data '{
"outlet": {
"access_token": "your_access_token_here",
"domain": "youroutletdomain.com"
},
"customer": {
"email_address": "[email protected]"
}
}'

Returns

{
"type": "active",
"canPurchaseEnrollment": false,
"expirationDate": "2025-01-01T04:00:00.000Z"
}