NAV
shell

Introduction

Welcome to the FreQenc API REST Service, which allows you to manage your products, stock orders and sale orders.

All API communications with the FreQenc API are organized around REST. Our API has predictable resource-oriented URLs, returns JSON-encoded responses and uses standard HTTP response codes and verbs.

Account Setup

Getting Started

In order to use our API, you will first need to obtain an account. Please contact us and we will assist you in setting up your account and sending you your account credentials.

Once you have received your account credentials, sign in and navigate to the Access Tokens page. A link to this can be found on the left sidebar. Click on Create Token and save the generated token in a secure place. You will not be able to view the token at a later stage in the FreQenc portal for security reasons.

Testing and Production enviroments

Please note that we will first set up your account on the testing environment https://dev.freqenc.com. When your integration is ready to move to production, you may contact us and we will set up your account on the production environment https://freqenc.com.

Authentication

To authorize every request:

curl "api_endpoint_here" \
  -H "Authorization: Bearer Access-Token"

Make sure to replace Access-Token with your personal access token.

FreQenc uses access tokens to authenticate access to the API. You can obtain an access token through the FreQenc portal once you sign in to your account.

Once you have an access token you need to authenticate every request to the API in a header field in the following form:

Authorization: Bearer Access-Token

Company

Get Company details

Example Request

curl -X GET "https://dev.freqenc.com/api/v3/company" \
     -H "Authorization: Bearer Access-Token" \
     -H "Accept: application/json"

Example Response

{
  "id": 1,
  "name": "Company A"
}

Shows your company details.

HTTP Request Verb

GET

Request Endpoint

/company

Request Query Parameters

None

Response Parameters

Parameter Description Type
id Unique id of your company integer
name Name of your company string

Sale Channels

List all Channels

Example Request

curl -X GET "https://dev.freqenc.com/api/v3/channels" \
     -H "Authorization: Bearer Access-Token" \
     -H "Accept: application/json"

Example Response

[
  {
    "id": 1,
    "name": "Sale Channel 1",
    "tel": null,
    "email": null,
    "website": null,
    "address_line_1": null,
    "address_line_2": null,
    "address_suburb": null,
    "address_city": null,
    "address_postcode": null
  },
  {
    "id": 2,
    "name": "Sale Channel 2",
    "tel": null,
    "email": null,
    "website": null,
    "address_line_1": null,
    "address_line_2": null,
    "address_suburb": null,
    "address_city": null,
    "address_postcode": null
  }
]

Shows a list of your company's sale channels.

HTTP Request Verb

GET

Request Endpoint

/channels

Request Query Parameters

None

Response Parameters

Parameter Description Type
id Unique id of the sale channel integer
name Name of the sale channel string
tel Telephone of the sale channel string
email Email of the sale channel string
website Website of the sale channel string
address_line_1 Address line 1 of the sale channel string
address_line_2 Address line 2 of the sale channel string
address_suburb Suburb of the sale channel string
address_city City of the sale channel string
address_postcode Postcode of the sale channel string

Get a Channel

Example Request

curl -X GET "https://dev.freqenc.com/api/v3/channels/1" \
     -H "Authorization: Bearer Access-Token" \
     -H "Accept: application/json"

Example Response

{
  "id": 1,
  "name": "Sale Channel 1",
  "tel": null,
  "email": null,
  "website": null,
  "address_line_1": null,
  "address_line_2": null,
  "address_suburb": null,
  "address_city": null,
  "address_postcode": null
}

Show a specific channel.

HTTP Request Verb

GET

Request Endpoint

/channels/{channel_id}

Request URL Parameters

Parameter Description
channel_id Unique channel id

Response Parameters

Parameter Description Type
id Unique id of the sale channel integer
name Name of the sale channel string
tel Telephone of the sale channel string
email Email of the sale channel string
website Website of the sale channel string
address_line_1 Address line 1 of the sale channel string
address_line_2 Address line 2 of the sale channel string
address_suburb Suburb of the sale channel string
address_city City of the sale channel string
address_postcode Postcode of the sale channel string

Couriers

List all Couriers

Example Request

curl -X GET "https://dev.freqenc.com/api/v3/couriers" \
     -H "Authorization: Bearer Access-Token" \
     -H "Accept: application/json"

Example Response

[
    {
        "id": 1,
        "name": "Collect"
    },
    {
        "id": 2,
        "name": "Skynet"
    },
    {
        "id": 3,
        "name": "CourierIT"
    },
    {
        "id": 4,
        "name": "TheCourierGuy"
    },
    {
        "id": 5,
        "name": "Collivery"
    },
    {
        "id": 6,
        "name": "Aramex"
    }
]

Shows a list of courier providers that can be used for order delivery.

HTTP Request Verb

GET

Request Endpoint

/couriers

Request Query Parameters

None

Response Parameters

Parameter Description Type
id Unique id of the courier provider integer
name Name of the courier provider string

Warehouses

List all Warehouses

Example Request

curl -X GET "https://dev.freqenc.com/api/v3/warehouses" \
     -H "Authorization: Bearer Access-Token" \
     -H "Accept: application/json"

Example Response

[
    {
        "id": 1,
        "name": "Warehouse A"
    }
    {
        "id": 2,
        "name": "Warehouse B"
    }
]

Shows a list of warehouses your company can use.

HTTP Request Verb

GET

Request Endpoint

/warehouses

Request Query Parameters

None

Response Parameters

Parameter Description Type
id Unique id of the warehouse integer
name Name of the warehouse string

Products

List all products

Example Request

curl -X GET "https://dev.freqenc.com/api/v3/products" \
     -H "Authorization: Bearer Access-Token" \
     -H "Accept: application/json"

Example Response

{
  "data": [
    {
      "id": 2,
      "sku": "ABC002",
      "name": "Product B",
      "price": 99.99,
      "width": 50,
      "length": 50,
      "height": 50,
      "weight": 0.2,
      "has_serial_numbers": true,
      "prepend_to_serial_numbers": "456",
      "append_to_serial_numbers": null,
      "channel_id": 1,
      "channel_name": "Channel 1",
      "created_at": "2021-01-01T12:00:00.000000Z",
      "updated_at": "2021-01-01T12:00:00.000000Z"
    },
    {
      "id": 1,
      "sku": "ABC001",
      "name": "Product A",
      "price": 250,
      "width": 50,
      "length": 50,
      "height": 50,
      "weight": 0.2,
      "has_serial_numbers": true,
      "prepend_to_serial_numbers": "123",
      "append_to_serial_numbers": null,
      "channel_id": 2,
      "channel_name": "Channel 2",
      "created_at": "2021-01-01T12:00:00.000000Z",
      "updated_at": "2021-01-01T12:00:00.000000Z"
    }
  ],
  "links": {
    "first": "https://dev.freqenc.com/api/v3/products?page=1",
    "last": null,
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "path": "https://dev.freqenc.com/api/v3/products",
    "per_page": 20,
    "to": 2
  }
}

Shows a paginated list of your company's products.

HTTP Request Verb

GET

Request endpoint

/products

Request Query Parameters

Parameter Description Required Default Note
channel_id Unique Sale Channel id No null Filter products by a channel
page Page number no 1 -
per_page Results per page no 20 max 100
sort_by Sort results by field no id Available: id, name, sku
sort_order Sort direction no desc Available: asc, desc

Response Parameters

Parameter Description Type
id Unique product id integer
sku Stock Keeping Unit id string
name Product name string
price Product retail price (ZAR) number
width Product width (cm) number
length Product length (cm) number
height Product height (cm) number
weight Product weight (kg) number
has_serial_numbers Flags product to allow serial numbers boolean
prepend_to_serial_numbers Prepended default value to a serial number string
append_to_serial_numbers Appended default value to a serial number string
channel_id Unique channel id the product is associated with integer
channel_name Name of the channel the product is associated with string
created_at Product creation date string
updated_at Last time product was updated string

Get a product

Example Request:

curl -X GET "https://dev.freqenc.com/api/v3/products/ABC002" \
     -H "Authorization: Bearer Access-Token" \
     -H "Accept: application/json"

Example Response:

{
  "id": 2,
  "sku": "ABC002",
  "name": "Product B",
  "price": 99.99,
  "width": 50,
  "length": 50,
  "height": 50,
  "weight": 0.2,
  "has_serial_numbers": true,
  "prepend_to_serial_numbers": "123",
  "append_to_serial_numbers": null,
  "channel_id": 1,
  "channel_name": "Channel 1",
  "created_at": "2021-01-01T12:00:00.000000Z",
  "updated_at": "2021-01-01T12:00:00.000000Z"
}

Show a product by sku.

HTTP Request Verb

GET

Request Endpoint

/products/{sku}

Request URL Parameters

Parameter Description
sku Unique product sku

Response Parameters

Parameter Description Type
id Unique product id integer
sku Stock Keeping Unit id string
name Product name string
price Product retail price (ZAR) number
width Product width (cm) number
length Product length (cm) number
height Product height (cm) number
weight Product weight (kg) number
has_serial_numbers Flags product to allow serial numbers boolean
prepend_to_serial_numbers Prepended default value to a serial number string
append_to_serial_numbers Appended default value to a serial number string
channel_id Unique channel id the product is associated with integer
channel_name Name of the channel the product is associated with string
created_at Product creation date string
updated_at Last time product was updated string

Create a product

Example Request:

curl -X POST "https://dev.freqenc.com/api/v3/products" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer Access Token" \
     -H "Accept: application/json" \
     -d '{
            "sku": "ABC002",
            "name": "Product B",
            "price": 99.99,
            "width": 50,
            "length": 50,
            "height": 50,
            "weight": 0.2,
            "has_serial_numbers": true,
            "prepend_to_serial_numbers": "456",
            "append_to_serial_numbers": null,
            "channel_id": 1
        }'

Example Response:

{
  "id": 2,
  "sku": "ABC002",
  "name": "Product B",
  "price": 99.99,
  "width": 50,
  "length": 50,
  "height": 50,
  "weight": 0.2,
  "has_serial_numbers": true,
  "prepend_to_serial_numbers": "456",
  "append_to_serial_numbers": null,
  "channel_id": 1,
  "channel_name": "Channel 1",
  "created_at": "2021-01-01T12:00:00.000000Z",
  "updated_at": "2021-01-01T12:00:00.000000Z"
}

Creates a product

HTTP Request Verb

POST

Request Endpoint

/products

Request Body Parameters

Parameter Description Type Required
sku Unique SKU of product string Yes
name Product name string Yes
price Product retail price (ZAR) number No
width Product width (cm) number Yes
length Product length (cm) number Yes
height Product height (cm) number Yes
weight Product weight (kg) number Yes
has_serial_numbers Flags product to allow serial numbers boolean No
prepend_to_serial_numbers Prepends a default value to a serial number string No
append_to_serial_numbers Appends a default value to a serial number string No
channel_id Unique channel id the product will be associated with integer Yes

Response Parameters

Parameter Description Type
id Unique product id integer
sku Stock Keeping Unit id string
name Product name string
price Product retail price (ZAR) number
width Product width (cm) number
length Product length (cm) number
height Product height (cm) number
weight Product weight (kg) number
has_serial_numbers Flags product to allow serial numbers boolean
prepend_to_serial_numbers Prepended default value to a serial number string
append_to_serial_numbers Appended default value to a serial number string
channel_id Unique channel id the product is associated with integer
channel_name Name of the channel the product is associated with string
created_at Product creation date string
updated_at Last time product was updated string

Update a product

Example Request:

curl -X PATCH "https://dev.freqenc.com/api/v3/products/ABC002" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer Access Token" \
     -H "Accept: application/json" \
     -d '{
            "name": "Product B",
            "price": 99.99,
            "width": 50,
            "length": 50,
            "height": 50,
            "weight": 0.2,
            "has_serial_numbers": true,
            "prepend_to_serial_numbers": "456",
            "append_to_serial_numbers": null,

        }'

Example Response:

{
  "id": 2,
  "sku": "ABC002",
  "name": "Product B",
  "price": 99.99,
  "width": 50,
  "length": 50,
  "height": 50,
  "weight": 0.2,
  "has_serial_numbers": true,
  "prepend_to_serial_numbers": "456",
  "append_to_serial_numbers": null,
  "channel_id": 1,
  "channel_name": "Channel 1",
  "created_at": "2021-01-01T12:00:00.000000Z",
  "updated_at": "2021-01-01T12:00:00.000000Z"
}

Update a product by sku

HTTP Request Verb

PATCH

Request Endpoint

/products/{sku}

Request URL Parameters

Parameter Description
sku Unique product sku number

Request Body Parameters

Parameter Description Type Required
name Product name string Yes
price Product retail price (ZAR) number No
width Product width (cm) number Yes
length Product length (cm) number Yes
height Product height (cm) number Yes
weight Product weight (kg) number Yes
has_serial_numbers Flags product to allow serial numbers boolean No
prepend_to_serial_numbers Prepends a default value to a serial number string No
append_to_serial_numbers Appends a default value to a serial number string No

Response Parameters

Parameter Description Type
id Unique product id integer
sku Stock Keeping Unit id string
name Product name string
price Product retail price (ZAR) number
width Product width (cm) number
length Product length (cm) number
height Product height (cm) number
weight Product weight (kg) number
has_serial_numbers Flags product to allow serial numbers boolean
prepend_to_serial_numbers Prepended default value to a serial number string
append_to_serial_numbers Appended default value to a serial number string
channel_id Unique channel id the product is associated with integer
channel_name Name of the channel the product is associated with string
created_at Product creation date string
updated_at Last time product was updated string

Get product inventory

Example Request:

curl -X GET "https://dev.freqenc.com/api/v3/products/ABC001/inventory" \
     -H "Authorization: Bearer Access-Token"
     -H "Accept: application/json" \

Example Response:

[
  {
    "qty": 3,
    "warehouse_id": 1,
    "serial_numbers": [
      {
        "serial_number": "ABC001-1-1",
        "batch_number": null,
        "expiry_date": null
      },
      {
        "serial_number": "ABC001-1-2",
        "batch_number": null,
        "expiry_date": null
      },
      {
        "serial_number": "ABC001-1-3",
        "batch_number": null,
        "expiry_date": null
      }
    ]
  }
]

Shows inventory details for a product by sku

HTTP Request Verb

GET

Request Endpoint

/products/{sku}/inventory

Request URL Parameters

Parameter Description
sku Unique product sku number

Response Parameters

Parameter Description Type
qty Product quantity integer
warehouse_id ID of the warehouse which will house the product integer
serial_number Product serial number string
batch_number Product batch number number
expiry_date Product expiry date string

Stock Orders

List stock orders

Example Request

curl -X GET "https://dev.freqenc.com/api/v3/stock-orders" \
     -H "Authorization: Bearer Access-Token" \
     -H "Accept: application/json" \

Example Response

{
  "data": [
    {
      "id": 2,
      "reference": "STOCK0002",
      "delivery_date": "2021-12-01",
      "received_date": "2021-01-05",
      "status": 4,
      "status_text": "Complete",
      "channel_id": 1,
      "channel_name": "Channel 1",
      "warehouse_id": 1,
      "stock_order_items": [
        {
          "id": 3,
          "qty": 2,
          "qty_received": 2,
          "product": {
            "id": 1,
            "name": "Product A",
            "sku": "ABC001",
            "serial_numbers": [
              {
                "serial_number": "ABC001-1-1",
                "batch_number": null,
                "expiry_date": null
              },
              {
                "serial_number": "ABC001-1-2",
                "batch_number": null,
                "expiry_date": null
              }
            ]
          },
          "created_at": "2021-01-01T12:00:00.000000Z",
          "updated_at": "2021-01-01T12:00:00.000000Z"
        }
      ],
      "created_at": "2021-01-01T12:00:00.000000Z",
      "updated_at": "2021-01-01T12:00:00.000000Z"
    },
    {
      "id": 1,
      "reference": "STOCK0001",
      "delivery_date": "2021-10-01",
      "received_date": "2021-01-05",
      "status": 4,
      "status_text": "Complete",
      "channel_id": 1,
      "channel_name": "Channel 1",
      "warehouse_id": 1,
      "stock_order_items": [
        {
          "id": 4,
          "qty": 5,
          "qty_received": 5,
          "product": {
            "id": 2,
            "name": "Product B",
            "sku": "ABC002"
          },
          "created_at": "2021-01-01T12:00:00.000000Z",
          "updated_at": "2021-01-01T12:00:00.000000Z"
        }
      ],
      "created_at": "2021-01-01T12:00:00.000000Z",
      "updated_at": "2021-01-01T12:00:00.000000Z"
    }
  ],
  "links": {
    "first": "https://dev.freqenc.com/api/v3/stock-orders?page=1",
    "last": null,
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "path": "https://dev.freqenc.com/api/v3/stock-orders",
    "per_page": 20,
    "to": 1
  }
}

Shows a paginated list of your company's stock orders.

HTTP Request Verb

GET

Request endpoint

/stock-orders

Request Query Parameters

Parameter Description Required Default Note
channel_id Filter stock orders by channel no null When included, only stock orders for that channel will be returned
page Page number no 1 -
per_page Results per page no 20 max 100
sort_by Sort results by field no id Available: id, reference
sort_order Sort direction no desc Available: asc, desc
status Filter results by order status no null See order status table below

Order Statuses

Status ID Status Text Status Description
1 Ready The stock order is finalised and ready to be received by the warehouse.
4 Complete The stock order has been received and processed by the warehouse.
-1 Cancelled The stock order has been cancelled.

Response Parameters

Parameter Description Type
id Unique stock order id integer
reference Uniquq Stock order reference string
delivery_date Estimated Date of delivery string
received_date Date stock order was received by the warehouse string
status Stock order status id integer
status_text Stock order status description string
channel_id Channel ID of stock order integer
channel_name Channel name of stock order string
warehouse_id ID of the warehouse where stock order will be received integer
stock_order_items.id Unique stock order item id integer
stock_order_items.qty Quantity of items in the stock order integer
stock_order_items.qty_received Quantity of item received by the warehouse integer
stock_order_items.product.id Unique product id integer
stock_order_items.product.name Product name string
stock_order_items.product.sku Unique Stock Keeping Unit id string
stock_order_items.product.serial_numbers.serial_number Product serial number string
stock_order_items.product.serial_numbers.batch_number Product batch number number
stock_order_items.product.serial_numbers.expiry_date Product expiry date string
stock_order_items.created_at Date when product was created string
stock_order_items.updated_at Last date when product was updated string
created_at Stock order creation date string
updated_at Last time stock order was updated string

Get a stock order

Example Request:

curl -X GET "https://dev.freqenc.com/api/v3/stock-orders/2" \
     -H "Authorization: Bearer Access-Token" \
     -H "Accept: application/json" \

Example Response:

{
  "id": 2,
  "reference": "STOCK0002",
  "delivery_date": "2021-12-01",
  "received_date": "2021-01-05",
  "status": 4,
  "status_text": "Complete",
  "channel_id": 1,
  "channel_name": "Channel 1",
  "warehouse_id": 1,
  "stock_order_items": [
    {
      "id": 3,
      "qty": 2,
      "qty_received": 2,
      "product": {
        "id": 1,
        "name": "Product A",
        "sku": "ABC001",
        "serial_numbers": [
          {
            "serial_number": "ABC001-1-1",
            "batch_number": null,
            "expiry_date": null
          },
          {
            "serial_number": "ABC001-1-2",
            "batch_number": null,
            "expiry_date": null
          }
        ]
      },
      "created_at": "2021-01-01T12:00:00.000000Z",
      "updated_at": "2021-01-01T12:00:00.000000Z"
    }
  ],
  "created_at": "2021-01-01T12:00:00.000000Z",
  "updated_at": "2021-01-01T12:00:00.000000Z"
}

Show a specific stock order by stock order id.

HTTP Request Verb

GET

Request Endpoint

/stock-orders/{id}

Request URL Parameters

Parameter Description
id Unique stock order id

Response Parameters

Parameter Description Type
id Unique stock order id integer
reference Stock order reference string
delivery_date Date of delivery string
received_date Received date string
status Stock order status id integer
status_text Stock order status description string
channel_id Channel ID of stock order integer
channel_name Channel name of stock order string
warehouse_id Warehouse id for stock order integer
stock_order_items.id Unique stock order item id integer
stock_order_items.qty Quantity of items in the stock order integer
stock_order_items.qty_received Quantity of item received by the warehouse integer
stock_order_items.product.id Unique product id integer
stock_order_items.product.name Product name string
stock_order_items.product.sku Unique Stock Keeping Unit id string
stock_order_items.product.serial_numbers.serial_number Product serial number string
stock_order_items.product.serial_numbers.batch_number Product batch number number
stock_order_items.product.serial_numbers.expiry_date Product expiry date string
stock_order_items.created_at Date when product was created string
stock_order_items.updated_at Last date when product was updated string
created_at Stock order creation date string
updated_at Last time stock order was updated string

Create a stock order

Example Request:

curl -X POST "https://dev.freqenc.com/api/v3/stock-orders" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer Access-Token" \
     -H "Accept: application/json" \
     -d '{
            "reference": "STOCK0004",
            "delivery_date": "2021-08-20",
            "channel_id": 1,
            "warehouse_id": 1,
            "stock_order_items" :[
                {
                    "sku": 123456,
                    "qty": 1
                },
                {
                    "sku": 789101,
                    "qty": 1
                }
            ]
         }'

Example Response:

{
  "id": 4,
  "reference": "STOCK0004",
  "delivery_date": "2021-08-20",
  "received_date": null,
  "status": 1,
  "status_text": "Ready",
  "channel_id": 1,
  "channel_name": "Channel 1",
  "warehouse_id": 1,
  "stock_order_items": [
    {
      "id": 3082,
      "qty": 1,
      "qty_received": null,
      "product": {
        "id": 4380,
        "name": "Product C",
        "sku": "123456"
      },
      "created_at": "2021-12-13T09:22:44.906084Z",
      "updated_at": "2021-12-13T09:22:44.906123Z"
    },
    {
      "id": 3083,
      "qty": 1,
      "qty_received": null,
      "product": {
        "id": 4083,
        "name": "Product D",
        "sku": "789101"
      },
      "created_at": "2021-12-13T09:22:44.908983Z",
      "updated_at": "2021-12-13T09:22:44.909016Z"
    }
  ],
  "created_at": "2021-01-01T12:00:00.000000Z",
  "updated_at": "2021-01-01T12:00:00.000000Z"
}

Create a stock order for your company

HTTP Request Verb

POST

Request Endpoint

/stock-orders

Request Body Parameters

Parameter Description Type Required
reference Your unique reference for the stock order string Yes
delivery_date Expected delivery date string Yes
channel_id ID of your channel for which the stock order is being created integer Yes
warehouse_id ID of the Warehouse where the stock order will be received integer Yes
stock_order_items.sku Unique Stock Keeping Unit id string Yes
stock_order_items.qty Quantity of items in the stock order integer Yes

Response Parameters

Parameter Description Type
id Unique stock order id integer
reference Stock order reference string
delivery_date Estimated date when stock order will be delivered to the warehouse string
received_date Date when stock order was received by the warehouse string
status Stock order status id integer
status_text Stock order status description string
channel_id Channel ID of stock order integer
channel_name Channel name of stock order string
warehouse_id Warehouse ID where stock order will be received integer
stock_order_items.id Unique stock order item id integer
stock_order_items.qty Quantity of items in the stock order integer
stock_order_items.qty_received Quantity of items received by the warehouse integer
stock_order_items.product.id Unique product id integer
stock_order_items.product.name Product name string
stock_order_items.product.sku Unique Stock Keeping Unit id string
stock_order_items.product.serial_numbers.serial_number Product serial number string
stock_order_items.product.serial_numbers.batch_number Product batch number number
stock_order_items.product.serial_numbers.expiry_date Product expiry date string
stock_order_items.created_at Date when product was created string
stock_order_items.updated_at Last date when product was updated string
created_at Stock order creation date string
updated_at Last time stock order was updated string

Update a stock order

Example Request:

curl -X PATCH "https://dev.freqenc.com/api/v3/stock-orders/5" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -H "Authorization: Bearer Access-Token" \
     -d '{
            "reference": "STOCK0004",
            "delivery_date": "2021-08-20",
            "warehouse_id": 1,
            "stock_order_items" :[
                {
                    "sku": 123456,
                    "qty": 2
                },
                {
                    "sku": 789101,
                    "qty": 2
                }
            ]
         }'

Example Response:

{
  "id": 5,
  "reference": "STOCK0004",
  "delivery_date": "2021-08-20",
  "received_date": null,
  "status": 1,
  "status_text": "Ready",
  "channel_id": 1,
  "channel_name": "Channel 1",
  "warehouse_id": 1,
  "stock_order_items": [
    {
      "id": 3082,
      "qty": 2,
      "qty_received": null,
      "product": {
        "id": 4380,
        "name": "Product C",
        "sku": "123456"
      },
      "created_at": "2021-12-13T09:22:44.906084Z",
      "updated_at": "2021-12-13T09:22:44.906123Z"
    },
    {
      "id": 3083,
      "qty": 2,
      "qty_received": null,
      "product": {
        "id": 4083,
        "name": "Product D",
        "sku": "789101"
      },
      "created_at": "2021-12-13T09:22:44.908983Z",
      "updated_at": "2021-12-13T09:22:44.909016Z"
    }
  ],
  "created_at": "2021-01-01T12:00:00.000000Z",
  "updated_at": "2021-01-01T12:00:00.000000Z"
}

Updates a stock order by stock order id

HTTP Request Verb

PATCH

Request Endpoint

/stock-orders/{id}

Request URL Parameters

Parameter Description
id Unique stock order id

Request Body Parameters

Parameter Description Type Required
reference Unique reference for stock order string Yes
delivery_date Expected delivery date string Yes
warehouse_id FreQenc warehouse id number Yes
stock_order_items.sku Unique Stock Keeping Unit id string Yes
stock_order_items.qty Quantity of items in the stock order integer Yes

Response Parameters

Parameter Description Type
id Unique stock order id integer
reference Stock order reference string
delivery_date Date of delivery string
received_date Received date string
status Stock order status id integer
status_text Stock order status description string
channel_id Channel ID of stock order integer
channel_name Channel name of stock order string
warehouse_id Warehouse id for stock order integer
stock_order_items.id Unique stock order item id integer
stock_order_items.qty Quantity of items in the stock order integer
stock_order_items.qty_received Quantity of item received by the warehouse integer
stock_order_items.product.id Unique product id integer
stock_order_items.product.name Product name string
stock_order_items.product.sku Unique Stock Keeping Unit id string
stock_order_items.product.serial_numbers.serial_number Product serial number string
stock_order_items.product.serial_numbers.batch_number Product batch number number
stock_order_items.product.serial_numbers.expiry_date Product expiry date string
stock_order_items.created_at Date when product was created string
stock_order_items.updated_at Last date when product was updated string
created_at Stock order creation date string
updated_at Last time stock order was updated string

Cancel a stock order

Example Request:

curl -X PATCH "https://dev.freqenc.com/api/v3/stock-orders/5/status" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -H "Authorization: Bearer Access-Token" \
     -d '{
            "status": -1
         }'

Example Response:

{
  "id": 5,
  "reference": "STOCK0004",
  "delivery_date": "2021-08-20",
  "received_date": null,
  "status": -1,
  "status_text": "Cancelled",
  "channel_id": 1,
  "channel_name": "Channel 1",
  "warehouse_id": 1,
  "stock_order_items": [
    {
      "id": 3082,
      "qty": 2,
      "qty_received": null,
      "product": {
        "id": 4380,
        "name": "Product C",
        "sku": "123456"
      },
      "created_at": "2021-12-13T09:22:44.906084Z",
      "updated_at": "2021-12-13T09:22:44.906123Z"
    },
    {
      "id": 3083,
      "qty": 2,
      "qty_received": null,
      "product": {
        "id": 4083,
        "name": "Product D",
        "sku": "789101"
      },
      "created_at": "2021-12-13T09:22:44.908983Z",
      "updated_at": "2021-12-13T09:22:44.909016Z"
    }
  ],
  "created_at": "2021-01-01T12:00:00.000000Z",
  "updated_at": "2021-01-01T12:00:00.000000Z"
}

Cancels a Stock Order by stock order id

HTTP Request Verb

PATCH

Request Endpoint

/stock-orders/{id}/status

Request URL Parameters

Parameter Description
id Unique stock order id

Request Body Parameters

Parameter Description Type Required
status Stock order status id integer Yes

Response Parameters

Parameter Description Type
id Unique stock order id integer
reference Stock order reference string
delivery_date Date of delivery string
received_date Received date string
status Stock order status id integer
status_text Stock order status description string
channel_id Channel ID of stock order integer
channel_name Channel name of stock order string
warehouse_id Warehouse id for stock order integer
stock_order_items.id Unique stock order item id integer
stock_order_items.qty Quantity of items in the stock order integer
stock_order_items.qty_received Quantity of item received by the warehouse integer
stock_order_items.product.id Unique product id integer
stock_order_items.product.name Product name string
stock_order_items.product.sku Unique Stock Keeping Unit id string
stock_order_items.product.serial_numbers.serial_number Product serial number string
stock_order_items.product.serial_numbers.batch_number Product batch number number
stock_order_items.product.serial_numbers.expiry_date Product expiry date string
stock_order_items.created_at Date when product was created string
stock_order_items.updated_at Last date when product was updated string
created_at Stock order creation date string
updated_at Last time stock order was updated string

Delete a stock order

Example Request:

curl -X DELETE "https://dev.freqenc.com/api/v3/stock-orders/5" \
     -H "Authorization: Bearer Access-Token"
     -H "Accept: application/json" \

Example Response:

{
  "message": "ok"
}

Delete a stock order by stock order id.

HTTP Request Verb

DELETE

Request Endpoint

/stock-orders/{id}

Request URL Parameters

Parameter Description
id Unique stock order id

Sale Orders

List sale orders

Example Request

curl -X GET "https://dev.freqenc.com/api/v3/sale-orders" \
     -H "Authorization: Bearer Access-Token" \
     -H "Accept: application/json" \

Example Response

{
  "data": [
    {
      "id": 2,
      "reference": "SALE0002",
      "recipient_name": "Jack Black",
      "recipient_id": null,
      "recipient_email": null,
      "recipient_tel_1": "0123456789",
      "recipient_tel_2": null,
      "address_building": null,
      "address_company": null,
      "address_line_1": "13 Fake Road",
      "address_line_2": null,
      "address_suburb": "Eldoraigne",
      "address_city": null,
      "address_province": null,
      "address_postcode": "0157",
      "residential_address_building": null,
      "residential_address_line_1": null,
      "residential_address_line_2": null,
      "residential_address_suburb": null,
      "residential_address_city": null,
      "residential_address_province": null,
      "residential_address_postcode": null,
      "extra_info_1": null,
      "extra_info_2": null,
      "delivery_notes": null,
      "status": 5,
      "status_text": "Dispatched",
      "channel_id": 1,
      "channel_name": "Channel 1",
      "warehouse_id": 1,
      "sale_order_items": [
        {
          "id": 60200,
          "qty": 1,
          "description": "Bundle ABC",
          "product": {
            "id": 4380,
            "name": "Product A",
            "sku": "123456",
            "notes": null,
            "serial_numbers": [
              {
                "serial_number": "1234567890",
                "batch_number": null,
                "expiry_date": null
              }
            ]
          },
          "created_at": "2021-01-01T12:00:00.000000Z",
          "updated_at": "2021-01-01T12:00:00.000000Z"
        },
        {
          "id": 60201,
          "qty": 1,
          "description": "Bundle ABC",
          "product": {
            "id": 4083,
            "name": "Product B",
            "sku": "789101",
            "notes": null,
            "serial_numbers": [
              {
                "serial_number": "0987654321",
                "batch_number": null,
                "expiry_date": null
              }
            ]
          },
          "created_at": "2021-01-01T12:00:00.000000Z",
          "updated_at": "2021-01-01T12:00:00.000000Z"
        }
      ],
      "sale_order_returns": [
        {
          "id": 28341,
          "sale_order_id": 80067,
          "return_waybill_number": "DBN1341098883",
          "return_status": 3,
          "return_status_text": "Complete",
          "sale_order_return_items": [
              {
                  "id": 29603,
                  "qty": 1,
                  "sale_order_return_id": 28341,
                  "product": {
                      "id": 4852,
                      "name": "Product A",
                      "sku": "123456",
                      "serial_numbers": [
                          {
                              "serial_number": "1234567890",
                              "batch_number": null,
                              "expiry_date": null,
                              "status": 7,
                              "status_text": "Reject processed",
                              "excluded_parts": [
                                  {
                                      "id": 4,
                                      "qty": 1,
                                      "description": "Outer carton"
                                  },
                                  {
                                      "id": 8,
                                      "qty": 1,
                                      "description": "inner carton"
                                  }
                              ],
                              "return_state": "Unsealed"
                          }
                      ]
                  },
                  "created_at": "2023-02-09T13:57:39.000000Z",
                  "updated_at": "2023-02-09T13:57:39.000000Z"
              }
          ],
          "created_at": "2023-02-09 15:57:39",
          "updated_at": "2023-02-13T07:09:46.000000Z"
        }
      ],
      "courier": {
        "id": 2,
        "name": "Skynet",
        "service": "ON2",
        "tracking_url": "https://web.skynet.co.za:5002/Tracking?trackingReference=ABCDEFG00001",
        "tracking_number": "ABCDEFG00001"
      },
      "created_at": "2021-01-01T12:00:00.000000Z",
      "updated_at": "2021-01-01T12:00:00.000000Z"
    }
  ],
  "links": {
    "first": "https://dev.freqenc.com/api/v3/sale-orders?page=1",
    "last": null,
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "path": "https://dev.freqenc.com/api/v3/sale-orders",
    "per_page": 20,
    "to": 1
  }
}

Shows a paginated list of your company's sale orders.

HTTP Request Verb

GET

Request endpoint

/sale-orders

Request Query Parameters

Parameter Description Required Default Note
channel_id ID of channel to filter sale orders by no null When included, only sale orders for that channel will be returned
page Page number no 1 -
per_page Results per page no 20 max 100
sort_by Sort results by field no id Available: id, reference
sort_order Sort direction no desc Available: asc, desc
status Filter results by order status no null See sales order status table below

Sale Order Statuses

Status ID Status Text Status Description
1 Ready Sale Order ready to be processed by the warehouse
3 Allocated Sale Order has been allocated by the warehouse
4 Packed Sale Order has been packed by the warehouse
5 Dispached Sale Order has been dispatched by the warehouse
-1 Cancelled Sale Order has been cancelled
-2 Could not allocate Sale Order could not be allocated by the warehouse

Sale Order Return Statuses

Status ID Status Text Status Description
1 Approvals Required Some/All items require approval before being returned
2 Processing Required Some/All items need to be returned by the warehouse after approval phase
3 Complete All returned items have been returned to stock

Response Parameters

Parameter Description Type
id Unique id of the sale order integer
reference Sale order reference number string
recipient_name Name of recipient string
recipient_id ID number of recipient string
recipient_email Email of recipient string
recipient_tel_1 Contact number of recipient string
recipient_tel_2 Alternative contact number of recipient string
address_building Building type/name of recipient string
address_company Company name of recipient string
address_line_1 Delivery address line 1 of recipient string
address_line_2 Delivery Address line 2 of recipient string
address_suburb Delivery suburb of recipient string
address_city Delivery city of recipient string
address_province Delivery province of recipient string
address_postcode Delivery postcode of recipient string
residential_address_building Residential building type/name of recipient string
residential_address_line_1 Residential address line 1 of recipient string
residential_address_line_2 Residential Address line 2 of recipient string
residential_address_suburb Residential suburb of recipient string
residential_address_city Residential city of recipient string
residential_address_province Residential province of recipient string
residential_address_postcode Residential postcode of recipient string
extra_info_1 Optional extra info 1 string
extra_info_2 Optional extra info 2 string
delivery_notes Delivery notes string
status Sale order status id integer
status_text Sale order status description string
channel_id ID of the channel for which the sale order was created integer
channel_name Name of the channel for which the sale order was created integer
warehouse_id Warehouse id for sale order integer
sale_order_items.id Sale Order item id integer
sale_order_items.qty Quantity of the sale order item integer
sale_order_items.description Any description you added to the sale order item string
sale_order_items.product.id ID of the sale order item product integer
sale_order_items.product.name Name of the sale order item product integer
sale_order_items.product.sku Unique SKU number of the sale order item product string
sale_order_items.product.notes Extra notes attached to product string
sale_order_items.product.serial_numbers.serial_number Unique serial number of the product sold string
sale_order_items.product.serial_numbers.batch_number Warehouse batch number of the product sold string
sale_order_items.product.serial_numbers.expiry_date Expiry date of the product sold string
sale_order_items.created_at Date when the sale order item was created on FreQenC string
sale_order_items.updated_at Date when the sale order item was last updated on FreQenC string
sale_order_returns Array of returns for the sale order array
sale_order_returns.id ID of the return integer
sale_order_returns.sale_order_id ID of the sale order for the return integer
sale_order_returns.return_waybill_number Waybill number for the return string
sale_order_returns.return_status Status of the return integer
sale_order_returns.return_status_text Status description of the return string
sale_order_returns.sale_order_return_items Array of items returned in a return array
sale_order_returns.sale_order_return_items.id ID of the sale order return item integer
sale_order_returns.sale_order_return_items.qty Quantity of items in the return integer
sale_order_returns.sale_order_return_items.sale_order_return_id ID of the sale order return integer
sale_order_returns.sale_order_return_items.product Product returned object
sale_order_returns.sale_order_return_items.product.id ID of the product integer
sale_order_returns.sale_order_return_items.product.name Name of the product string
sale_order_returns.sale_order_return_items.product.sku SKU of the product string
sale_order_returns.sale_order_return_items.product.serial_numbers Array of data for the product array
sale_order_returns.sale_order_return_items.product.serial_numbers.serial_number Serial number of product string
sale_order_returns.sale_order_return_items.product.serial_numbers.batch_number batch number of product string
sale_order_returns.sale_order_return_items.product.serial_numbers.expiry_date Expiry date of product string
sale_order_returns.sale_order_return_items.product.serial_numbers.status Status of returned product integer
sale_order_returns.sale_order_return_items.product.serial_numbers.status_text Status description of returned product string
sale_order_returns.sale_order_return_items.product.serial_numbers.return_state State of returned product string
sale_order_returns.sale_order_return_items.product.serial_numbers.excluded_parts Array of parts not included in return array
sale_order_returns.sale_order_return_items.product.serial_numbers.excluded_parts.id Excluded part id integer
sale_order_returns.sale_order_return_items.product.serial_numbers.excluded_parts.qty Excluded part qty integer
sale_order_returns.sale_order_return_items.product.serial_numbers.excluded_parts.description Excluded part description string
courier.id ID of the courier used to dispatch the sale order string
courier.name Name of the courier used to dispatch the sale order string
courier.service Courier Service Level used string
courier.tracking_url URL used to track the delivery status of the sale order string
courier.tracking_number Tracking number to track the delivery of the sale order string
created_at Sale order creation date string
updated_at Last time sale order was updated string

Get a sale order

Example Request

curl -X GET "https://dev.freqenc.com/api/v3/sale-orders/2" \
     -H "Authorization: Bearer Access-Token" \
     -H "Accept: application/json" \

Example Response

{
  "id": 2,
  "reference": "SALE0002",
  "recipient_name": "Jack Black",
  "recipient_id": null,
  "recipient_email": null,
  "recipient_tel_1": "0123456789",
  "recipient_tel_2": null,
  "address_building": null,
  "address_company": null,
  "address_line_1": "13 Fake Road",
  "address_line_2": null,
  "address_suburb": "Eldoraigne",
  "address_city": null,
  "address_province": null,
  "address_postcode": "0157",
  "residential_address_building": null,
  "residential_address_line_1": null,
  "residential_address_line_2": null,
  "residential_address_suburb": null,
  "residential_address_city": null,
  "residential_address_province": null,
  "residential_address_postcode": null,
  "extra_info_1": null,
  "extra_info_2": null,
  "delivery_notes": null,
  "status": 5,
  "status_text": "Dispatched",
  "channel_id": 1,
  "channel_name": "Channel 1",
  "warehouse_id": 1,
  "sale_order_items": [
    {
      "id": 60200,
      "qty": 1,
      "description": "Bundle ABC",
      "product": {
        "id": 4380,
        "name": "Product A",
        "sku": "123456",
        "notes": null,
        "serial_numbers": [
          {
            "serial_number": "1234567890",
            "batch_number": null,
            "expiry_date": null
          }
        ]
      },
      "created_at": "2021-01-01T12:00:00.000000Z",
      "updated_at": "2021-01-01T12:00:00.000000Z"
    },
    {
      "id": 60201,
      "qty": 1,
      "description": "Bundle DEF",
      "product": {
        "id": 4083,
        "name": "Product B",
        "sku": "789101",
        "notes": null,
        "serial_numbers": [
          {
            "serial_number": "0987654321",
            "batch_number": null,
            "expiry_date": null
          }
        ]
      },
      "created_at": "2021-01-01T12:00:00.000000Z",
      "updated_at": "2021-01-01T12:00:00.000000Z"
    }
  ],
  "sale_order_returns": [
    {
      "id": 28341,
      "sale_order_id": 80067,
      "return_waybill_number": "DBN1341098883",
      "return_status": 3,
      "return_status_text": "Complete",
      "sale_order_return_items": [
          {
              "id": 29603,
              "qty": 1,
              "sale_order_return_id": 28341,
              "product": {
                  "id": 4852,
                  "name": "Product A",
                  "sku": "123456",
                  "serial_numbers": [
                      {
                          "serial_number": "1234567890",
                          "batch_number": null,
                          "expiry_date": null,
                          "status": 7,
                          "status_text": "Reject processed",
                          "excluded_parts": [
                              {
                                  "id": 4,
                                  "qty": 1,
                                  "description": "Outer carton"
                              },
                              {
                                  "id": 8,
                                  "qty": 1,
                                  "description": "inner carton"
                              }
                          ],
                          "return_state": "Unsealed"
                      }
                  ]
              },
              "created_at": "2023-02-09T13:57:39.000000Z",
              "updated_at": "2023-02-09T13:57:39.000000Z"
          }
      ],
      "created_at": "2023-02-09 15:57:39",
      "updated_at": "2023-02-13T07:09:46.000000Z"
    }
  ],
  "courier": {
    "id": 2,
    "name": "Skynet",
    "service": "ON2",
    "tracking_url": "https://web.skynet.co.za:5002/Tracking?trackingReference=ABCDEFG00001",
    "tracking_number": "ABCDEFG00001"
  },
  "created_at": "2021-01-01T12:00:00.000000Z",
  "updated_at": "2021-01-01T12:00:00.000000Z"
}

Show a sale order by sale order id.

HTTP Request Verb

GET

Request Endpoint

/sale-orders/{id}

Request URL Parameters

Parameter Description
id Unique sale order id

Response Parameters

Parameter Description Type
id Unique id of the sale order integer
reference Sale order reference number string
recipient_name Name of recipient string
recipient_id ID number of recipient string
recipient_email Email of recipient string
recipient_tel_1 Contact number of recipient string
recipient_tel_2 Alternative contact number of recipient string
address_building Building type/name of recipient string
address_company Company name of recipient string
address_line_1 Delivery address line 1 of recipient string
address_line_2 Delivery Address line 2 of recipient string
address_suburb Delivery suburb of recipient string
address_city Delivery city of recipient string
address_province Delivery province of recipient string
address_postcode Delivery postcode of recipient string
residential_address_building Residential building type/name of recipient string
residential_address_line_1 Residential address line 1 of recipient string
residential_address_line_2 Residential Address line 2 of recipient string
residential_address_suburb Residential suburb of recipient string
residential_address_city Residential city of recipient string
residential_address_province Residential province of recipient string
residential_address_postcode Residential postcode of recipient string
extra_info_1 Optional extra info 1 string
extra_info_2 Optional extra info 2 string
delivery_notes Delivery notes string
status Sale order status id integer
status_text Sale order status description string
channel_id ID of the channel for which the sale order was created integer
channel_name Name of the channel for which the sale order was created integer
warehouse_id Warehouse id for sale order integer
sale_order_items.id Sale Order item id integer
sale_order_items.qty Quantity of the sale order item integer
sale_order_items.description Any description you added to the sale order item string
sale_order_items.product.id ID of the sale order item product integer
sale_order_items.product.name Name of the sale order item product integer
sale_order_items.product.sku Unique SKU number of the sale order item product string
sale_order_items.product.notes Extra notes attached to product string
sale_order_items.product.serial_numbers.serial_number Unique serial number of the product sold string
sale_order_items.product.serial_numbers.batch_number Warehouse batch number of the product sold string
sale_order_items.product.serial_numbers.expiry_date Expiry date of the product sold string
sale_order_items.created_at Date when the sale order item was created on FreQenC string
sale_order_items.updated_at Date when the sale order item was last updated on FreQenC string
sale_order_returns Array of returns for the sale order array
sale_order_returns.id ID of the return integer
sale_order_returns.sale_order_id ID of the sale order for the return integer
sale_order_returns.return_waybill_number Waybill number for the return string
sale_order_returns.return_status Status of the return integer
sale_order_returns.return_status_text Status description of the return string
sale_order_returns.sale_order_return_items Array of items returned in a return array
sale_order_returns.sale_order_return_items.id ID of the sale order return item integer
sale_order_returns.sale_order_return_items.qty Quantity of items in the return integer
sale_order_returns.sale_order_return_items.sale_order_return_id ID of the sale order return integer
sale_order_returns.sale_order_return_items.product Product returned object
sale_order_returns.sale_order_return_items.product.id ID of the product integer
sale_order_returns.sale_order_return_items.product.name Name of the product string
sale_order_returns.sale_order_return_items.product.sku SKU of the product string
sale_order_returns.sale_order_return_items.product.serial_numbers Array of data for the product array
sale_order_returns.sale_order_return_items.product.serial_numbers.serial_number Serial number of product string
sale_order_returns.sale_order_return_items.product.serial_numbers.batch_number batch number of product string
sale_order_returns.sale_order_return_items.product.serial_numbers.expiry_date Expiry date of product string
sale_order_returns.sale_order_return_items.product.serial_numbers.status Status of returned product integer
sale_order_returns.sale_order_return_items.product.serial_numbers.status_text Status description of returned product string
sale_order_returns.sale_order_return_items.product.serial_numbers.return_state State of returned product string
sale_order_returns.sale_order_return_items.product.serial_numbers.excluded_parts Array of parts not included in return array
sale_order_returns.sale_order_return_items.product.serial_numbers.excluded_parts.id Excluded part id integer
sale_order_returns.sale_order_return_items.product.serial_numbers.excluded_parts.qty Excluded part qty integer
sale_order_returns.sale_order_return_items.product.serial_numbers.excluded_parts.description Excluded part description string
courier.id ID of the courier used to dispatch the sale order string
courier.name Name of the courier used to dispatch the sale order string
courier.service Courier Service level used string
courier.tracking_url URL used to track the delivery status of the sale order string
courier.tracking_number Tracking number to track the delivery of the sale order string
created_at Sale order creation date string
updated_at Last time sale order was updated string

Create a sale order

Example Request:

curl -X POST "https://dev.freqenc.com/api/v3/sale-orders" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer Access-Token" \
     -H "Accept: application/json" \
     -d '{
            "reference": "SALE0003",
            "recipient_name": "Dave Mathews",
            "recipient_tel_1": "0129876543",
            "address_line_1": "9 Main Road",
            "address_suburb": "Suburb",
            "address_postcode": "0000",
            "channel_id": 1,
            "warehouse_id": 1,
            "sale_order_items" :[
                {
                    "sku": 123456,
                    "qty": 1,
                    "description": "Bundle ABC"
                },
                {
                    "sku": 789101,
                    "qty": 1,
                    "description": "Bundle ABC"
                }
            ]
        }'

Example Response:

{
  "id": 4,
  "reference": "SALE0003",
  "recipient_name": "Dave Mathews",
  "recipient_id": null,
  "recipient_email": null,
  "recipient_tel_1": "0129876543",
  "recipient_tel_2": null,
  "address_building": null,
  "address_company": null,
  "address_line_1": "9 Main Road",
  "address_line_2": null,
  "address_suburb": "Suburb",
  "address_city": null,
  "address_province": null,
  "address_postcode": "0000",
  "residential_address_building": null,
  "residential_address_line_1": null,
  "residential_address_line_2": null,
  "residential_address_suburb": null,
  "residential_address_city": null,
  "residential_address_province": null,
  "residential_address_postcode": null,
  "extra_info_1": null,
  "extra_info_2": null,
  "delivery_notes": null,
  "status": 1,
  "status_text": "Ready",
  "channel_id": 1,
  "channel_name": "Channel 1",
  "warehouse_id": 1,
  "sale_order_items": [
    {
      "id": 60212,
      "qty": 1,
      "description": "Bundle ABC",
      "product": {
        "id": 4380,
        "name": "Product A",
        "sku": "123456",
        "notes": null,
        "serial_numbers": []
      },
      "created_at": "2021-01-01T12:00:00.000000Z",
      "updated_at": "2021-01-01T12:00:00.000000Z"
    },
    {
      "id": 60213,
      "qty": 1,
      "description": "Bundle ABC",
      "product": {
        "id": 4083,
        "name": "Product B",
        "sku": "789101",
        "notes": null,
        "serial_numbers": []
      },
      "created_at": "2021-01-01T12:00:00.000000Z",
      "updated_at": "2021-01-01T12:00:00.000000Z"
    }
  ],
  "created_at": "2021-01-01T12:00:00.000000Z",
  "updated_at": "2021-01-01T12:00:00.000000Z"
}

Creates a sale order for your company

HTTP Request Verb

POST

Request Endpoint

/sale-orders

Request Body Parameters

Parameter Description Type Required
reference Sale order reference number string Yes
recipient_name Name of recipient string Yes
recipient_id ID number of recipient string No
recipient_email Email of recipient string No
recipient_tel_1 Contact number of recipient string Yes
recipient_tel_2 Alternative contact number of recipient string No
address_building Building type/name of recipient string No
address_company Company name of recipient string No
address_line_1 Delivery address line 1 of recipient string Yes
address_line_2 Delivery Address line 2 of recipient string No
address_suburb Delivery suburb of recipient string Yes
address_city Delivery city of recipient string No
address_province Delivery province of recipient string No
address_postcode Delivery postcode of recipient string Yes
residential_address_building Residential building type/name of recipient string No
residential_address_line_1 Residential address line 1 of recipient string No
residential_address_line_2 Residential Address line 2 of recipient string No
residential_address_suburb Residential suburb of recipient string If residential_address_line_1 is set
residential_address_city Residential city of recipient string No
residential_address_province Residential province of recipient string No
residential_address_postcode Residential postcode of recipient string If residential_address_line_1 is set
extra_info_1 Optional extra info 1 string No
extra_info_2 Optional extra info 2 string No
delivery_notes Delivery notes string No
channel_id ID of the channel the sale order is created for integer Yes
courier_id ID of the courier that should be used for delivery integer No
warehouse_id Warehouse id for sale order integer Yes
sale_order_items.sku Unique SKU number of the sale order item product string Yes
sale_order_items.qty Quantity of the sale order item integer Yes
sale_order_items.description Any description you'd like to add to the sale order item string No

Response Parameters

Parameter Description Type
id Unique id of the sale order integer
reference Sale order reference number string
recipient_name Name of recipient string
recipient_id ID number of recipient string
recipient_email Email of recipient string
recipient_tel_1 Contact number of recipient string
recipient_tel_2 Alternative contact number of recipient string
address_building Building type/name of recipient string
address_company Company name of recipient string
address_line_1 Delivery address line 1 of recipient string
address_line_2 Delivery Address line 2 of recipient string
address_suburb Delivery suburb of recipient string
address_city Delivery city of recipient string
address_province Delivery province of recipient string
address_postcode Delivery postcode of recipient string
residential_address_building Residential building type/name of recipient string
residential_address_line_1 Residential address line 1 of recipient string
residential_address_line_2 Residential Address line 2 of recipient string
residential_address_suburb Residential suburb of recipient string
residential_address_city Residential city of recipient string
residential_address_province Residential province of recipient string
residential_address_postcode Residential postcode of recipient string
extra_info_1 Optional extra info 1 string
extra_info_2 Optional extra info 2 string
delivery_notes Delivery notes string
status Sale order status id integer
status_text Sale order status description string
channel_id ID of the channel for which the sale order was created integer
channel_name Name of the channel for which the sale order was created integer
warehouse_id Warehouse id for sale order integer
sale_order_items.id Sale Order item id integer
sale_order_items.qty Quantity of the sale order item integer
sale_order_items.description Any description you added to the sale order item string
sale_order_items.product.id ID of the sale order item product integer
sale_order_items.product.name Name of the sale order item product integer
sale_order_items.product.sku Unique SKU number of the sale order item product string
sale_order_items.product.notes Extra notes attached to product string
sale_order_items.created_at Date when the sale order item was created on FreQenC string
sale_order_items.updated_at Date when the sale order item was last updated on FreQenC string
created_at Sale order creation date string
updated_at Last time sale order was updated string

Update a sale order

Example Request:

curl -X PATCH "https://dev.freqenc.com/api/v3/sale-orders/4" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer Access-Token" \
     -H "Accept: application/json" \
     -d '{
            "reference": "SALE0003",
            "recipient_name": "Dave Mathews",
            "recipient_tel_1": "0129876543",
            "address_line_1": "10 New Road",
            "address_suburb": "Suburb",
            "address_postcode": "0000",
            "warehouse_id": 1,
            "sale_order_items" :[
                {
                    "sku": 123456,
                    "qty": 2,
                    "description": "Bundle ABC",
                },
                {
                    "sku": 789101,
                    "qty": 1,
                    "description": "Bundle ABC",
                }
            ]
        }'

Example Response:

{
  "id": 4,
  "reference": "SALE0003",
  "recipient_name": "Dave Mathews",
  "recipient_id": null,
  "recipient_email": null,
  "recipient_tel_1": "0129876543",
  "recipient_tel_2": null,
  "address_building": null,
  "address_company": null,
  "address_line_1": "10 Main Road",
  "address_line_2": null,
  "address_suburb": "Suburb",
  "address_city": null,
  "address_province": null,
  "address_postcode": "0000",
  "residential_address_building": null,
  "residential_address_line_1": null,
  "residential_address_line_2": null,
  "residential_address_suburb": null,
  "residential_address_city": null,
  "residential_address_province": null,
  "residential_address_postcode": null,
  "extra_info_1": null,
  "extra_info_2": null,
  "delivery_notes": null,
  "status": 1,
  "status_text": "Ready",
  "channel_id": 1,
  "channel_name": "Channel 1",
  "warehouse_id": 1,
  "sale_order_items": [
    {
      "id": 60212,
      "qty": 2,
      "description": "Bundle ABC",
      "product": {
        "id": 4380,
        "name": "Product A",
        "sku": "123456",
        "notes": null,
        "serial_numbers": []
      },
      "created_at": "2021-01-01T12:00:00.000000Z",
      "updated_at": "2021-01-01T12:00:00.000000Z"
    },
    {
      "id": 60213,
      "qty": 1,
      "description": "Bundle ABC",
      "product": {
        "id": 4083,
        "name": "Product B",
        "sku": "789101",
        "notes": null,
        "serial_numbers": []
      },
      "created_at": "2021-01-01T12:00:00.000000Z",
      "updated_at": "2021-01-01T12:00:00.000000Z"
    }
  ],
  "created_at": "2021-01-01T12:00:00.000000Z",
  "updated_at": "2021-01-01T12:00:00.000000Z"
}

Updates a sale order for your company

HTTP Request Verb

PATCH

Request Endpoint

/sale-orders/{id}

Request URL Parameters

Parameter Description
id Unique sale order id

Request Body Parameters

Parameter Description Type Required
reference Sale order reference number string Yes
recipient_name Name of recipient string Yes
recipient_id ID number of recipient string No
recipient_email Email of recipient string No
recipient_tel_1 Contact number of recipient string Yes
recipient_tel_2 Alternative contact number of recipient string No
address_building Building type/name of recipient string No
address_company Company name of recipient string No
address_line_1 Delivery address line 1 of recipient string Yes
address_line_2 Delivery Address line 2 of recipient string No
address_suburb Delivery suburb of recipient string Yes
address_city Delivery city of recipient string No
address_province Delivery province of recipient string No
address_postcode Delivery postcode of recipient string Yes
residential_address_building Residential building type/name of recipient string No
residential_address_line_1 Residential address line 1 of recipient string No
residential_address_line_2 Residential Address line 2 of recipient string No
residential_address_suburb Residential suburb of recipient string If residential_address_line_1 is set
residential_address_city Residential city of recipient string No
residential_address_province Residential province of recipient string No
residential_address_postcode Residential postcode of recipient string If residential_address_line_1 is set
extra_info_1 Optional extra info 1 string No
extra_info_2 Optional extra info 2 string No
delivery_notes Delivery notes string No
warehouse_id Warehouse id for sale order integer Yes
sale_order_items.sku Unique SKU number of the sale order item product string Yes
sale_order_items.qty Quantity of the sale order item integer Yes
sale_order_items.description Any description you'd like to add to the sale order item string No

Response Parameters

Parameter Description Type
id Unique id of the sale order integer
reference Sale order reference number string
recipient_name Name of recipient string
recipient_id ID number of recipient string
recipient_email Email of recipient string
recipient_tel_1 Contact number of recipient string
recipient_tel_2 Alternative contact number of recipient string
address_building Building type/name of recipient string
address_company Company name of recipient string
address_line_1 Delivery address line 1 of recipient string
address_line_2 Delivery Address line 2 of recipient string
address_suburb Delivery suburb of recipient string
address_city Delivery city of recipient string
address_province Delivery province of recipient string
address_postcode Delivery postcode of recipient string
residential_address_building Residential building type/name of recipient string
residential_address_line_1 Residential address line 1 of recipient string
residential_address_line_2 Residential Address line 2 of recipient string
residential_address_suburb Residential suburb of recipient string
residential_address_city Residential city of recipient string
residential_address_province Residential province of recipient string
residential_address_postcode Residential postcode of recipient string
extra_info_1 Optional extra info 1 string
extra_info_2 Optional extra info 2 string
delivery_notes Delivery notes string
status Sale order status id integer
status_text Sale order status description string
channel_id ID of the channel for which the sale order was created integer
channel_name Name of the channel for which the sale order was created integer
warehouse_id Warehouse id for sale order integer
sale_order_items.id Sale Order item id integer
sale_order_items.qty Quantity of the sale order item integer
sale_order_items.description Any description you added to the sale order item string
sale_order_items.product.id ID of the sale order item product integer
sale_order_items.product.name Name of the sale order item product integer
sale_order_items.product.sku Unique SKU number of the sale order item product string
sale_order_items.product.notes Extra notes attached to product string
sale_order_items.created_at Date when the sale order item was created on FreQenC string
sale_order_items.updated_at Date when the sale order item was last updated on FreQenC string
created_at Sale order creation date string
updated_at Last time sale order was updated string

Cancel a sale order

Example Request:

curl -X PATCH "https://dev.freqenc.com/api/v3/sale-orders/4/status" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer Access-Token" \
     -H "Accept: application/json" \
     -d '{
            "status": -1
         }'

Example Response:

{
  "id": 4,
  "reference": "SALE0003",
  "recipient_name": "Dave Mathews",
  "recipient_id": null,
  "recipient_email": null,
  "recipient_tel_1": "0129876543",
  "recipient_tel_2": null,
  "address_building": null,
  "address_company": null,
  "address_line_1": "10 Main Road",
  "address_line_2": null,
  "address_suburb": "Suburb",
  "address_city": null,
  "address_province": null,
  "address_postcode": "0000",
  "residential_address_building": null,
  "residential_address_line_1": null,
  "residential_address_line_2": null,
  "residential_address_suburb": null,
  "residential_address_city": null,
  "residential_address_province": null,
  "residential_address_postcode": null,
  "extra_info_1": null,
  "extra_info_2": null,
  "delivery_notes": null,
  "status": -1,
  "status_text": "Cancelled",
  "channel_id": 1,
  "channel_name": "Channel 1",
  "warehouse_id": 1,
  "sale_order_items": [
    {
      "id": 60212,
      "qty": 2,
      "description": "Bundle ABC",
      "product": {
        "id": 4380,
        "name": "Product A",
        "sku": "123456",
        "notes": null,
        "serial_numbers": []
      },
      "created_at": "2021-01-01T12:00:00.000000Z",
      "updated_at": "2021-01-01T12:00:00.000000Z"
    },
    {
      "id": 60213,
      "qty": 1,
      "description": "Bundle ABC",
      "product": {
        "id": 4083,
        "name": "Product B",
        "sku": "789101",
        "notes": null,
        "serial_numbers": []
      },
      "created_at": "2021-01-01T12:00:00.000000Z",
      "updated_at": "2021-01-01T12:00:00.000000Z"
    }
  ],
  "created_at": "2021-01-01T12:00:00.000000Z",
  "updated_at": "2021-01-01T12:00:00.000000Z"
}

Cancels a sale order created by your company

HTTP Request Verb

PATCH

Request Endpoint

/sale-orders/{id}/status

Request URL Parameters

Parameter Description
id Unique sale order id

Request Body Parameters

Parameter Description Type Required
status Sale order status integer Yes

Response Parameters

Parameter Description Type
id Unique id of the sale order integer
reference Sale order reference number string
recipient_name Name of recipient string
recipient_id ID number of recipient string
recipient_email Email of recipient string
recipient_tel_1 Contact number of recipient string
recipient_tel_2 Alternative contact number of recipient string
address_building Building type/name of recipient string
address_company Company name of recipient string
address_line_1 Delivery address line 1 of recipient string
address_line_2 Delivery Address line 2 of recipient string
address_suburb Delivery suburb of recipient string
address_city Delivery city of recipient string
address_province Delivery province of recipient string
address_postcode Delivery postcode of recipient string
residential_address_building Residential building type/name of recipient string
residential_address_line_1 Residential address line 1 of recipient string
residential_address_line_2 Residential Address line 2 of recipient string
residential_address_suburb Residential suburb of recipient string
residential_address_city Residential city of recipient string
residential_address_province Residential province of recipient string
residential_address_postcode Residential postcode of recipient string
extra_info_1 Optional extra info 1 string
extra_info_2 Optional extra info 2 string
delivery_notes Delivery notes string
status Sale order status id integer
status_text Sale order status description string
channel_id ID of the channel for which the sale order was created integer
channel_name Name of the channel for which the sale order was created integer
warehouse_id Warehouse id for sale order integer
sale_order_items.id Sale Order item id integer
sale_order_items.qty Quantity of the sale order item integer
sale_order_items.description Any description you added to the sale order item string
sale_order_items.product.id ID of the sale order item product integer
sale_order_items.product.name Name of the sale order item product integer
sale_order_items.product.sku Unique SKU number of the sale order item product string
sale_order_items.product.notes Extra notes attached to product string
sale_order_items.created_at Date when the sale order item was created on FreQenC string
sale_order_items.updated_at Date when the sale order item was last updated on FreQenC string
created_at Sale order creation date string
updated_at Last time sale order was updated string

Delete a sale order

Example Request:

curl -X DELETE "https://dev.freqenc.com/api/v3/sale-orders/4" \
     -H "Authorization: Bearer Access-Token" \
     -H "Accept: application/json" \

Example Response:

{
  "message": "ok"
}

Delete a sale order by sale order id.

HTTP Request Verb

DELETE

Request Endpoint

/sale-orders/{id}

Request URL Parameters

Parameter Description
id Unique sale order id

Sale Order Tracking

Get Tracking Events

Example Request

curl -X GET "https://dev.freqenc.com/api/v3/sale-orders/2/tracking-events" \
     -H "Authorization: Bearer Access-Token" \
     -H "Accept: application/json" \

Example Response (if tracking events are available)

{
  "data": [
    {
      "date": "2021-10-02",
      "time": "19:02:00",
      "location": "HostServer",
      "description": "Delivered"
    },
    {
      "date": "2021-10-02",
      "time": "14:30:00",
      "location": "Pretoria",
      "description": "POD created"
    },
    {
      "date": "2021-10-02",
      "time": "14:30:00",
      "location": "Pretoria",
      "description": "Delivered"
    },
    {
      "date": "2021-10-02",
      "time": "08:43:19",
      "location": "Pretoria",
      "description": "Out on Delivery"
    },
    {
      "date": "2021-10-02",
      "time": "05:44:30",
      "location": "Pretoria",
      "description": "Received In Branch Pretoria"
    },
    {
      "date": "2021-10-02",
      "time": "02:05:20",
      "location": "Elandsfontein",
      "description": "Out on Line Haul"
    },
    {
      "date": "2021-09-02",
      "time": "23:12:15",
      "location": "Elandsfontein",
      "description": "Parcel Label Printed"
    },
    {
      "date": "2021-09-02",
      "time": "14:46:20",
      "location": "Elandsfontein",
      "description": "On Hold Parcel Created"
    },
    {
      "date": "2021-09-02",
      "time": "14:46:20",
      "location": "Elandsfontein",
      "description": "Created waybill"
    }
  ]
}

Example Response (if NO tracking events are available)

{
  "data": []
}

Get all sale order tracking events.

HTTP Request Verb

GET

Request Endpoint

/sale-orders/{id}/tracking-events

Request URL Parameters

Parameter Description
id Unique sale order id

Response Parameters

Parameter Description Type
date Date of tracking event string
time Time of tracking event string
location Location for tracking event string
description Description of tracking event string

Get Tracking POD

Example Request

curl -X GET "https://dev.freqenc.com/api/v3/sale-orders/2/tracking-pod" \
     -H "Authorization: Bearer Access-Token" \
     -H "Accept: application/json" \

Example Response

{
  "type": "pdf",
  "base64_encoded": "JVBERi0xLjQKJfbk/N8KMSAwIG9iago8PAovVHlwZS......"
}

Get sale order tracking POD.

HTTP Request Verb

GET

Request Endpoint

/sale-orders/{id}/tracking-pod

Request URL Parameters

Parameter Description
id Unique sale order id

Response Parameters

Parameter Description Type
type Format of POD string
base64_encoded Data of POD in base_64 string

Errors

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The request was denied.
404 Not Found -- The resource you specified was not found.
405 Method Not Allowed -- You tried to access a resource with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
410 Gone -- The resource requested has been removed from our servers.
429 Too Many Requests -- Too many requests.
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.