Use this API resources to CRUD trucking companies.

Supported Formats

json

GET /api/v1/trucking_companies
Returns the list of trucking companies

This API endpoint will allow you to get a list of trucking companies. You can filter by using different query parameters such as name or general_ledger_id.

Supported Formats

json

Errors

Code Description
400 Bad Request.
404 Not Found.
500 Internal Server Error.

Examples

curl "https://app.octopi.co/api/v1/trucking_companies.json?name=Octopi" -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE"
{
   "trucking_companies" : [
      {
         "phone" : null,
         "name" : "FC OCTOPI",
         "code" : null,
         "general_ledger_id" : null,
         "vat_number" : "2122",
         "email" : null,
         "id" : 337395,
         "address" : null,
         "contact_person" : null
      },
      {
         "address" : null,
         "contact_person" : null,
         "id" : 337386,
         "email" : null,
         "general_ledger_id" : null,
         "vat_number" : "222",
         "phone" : null,
         "code" : null,
         "name" : "INTER OCTOPI"
      },
      {
         "email" : null,
         "general_ledger_id" : null,
         "vat_number" : "2224",
         "phone" : null,
         "code" : null,
         "name" : "OCTOPI UNITED FC",
         "address" : null,
         "contact_person" : null,
         "id" : 337385
      }
   ]
}

Params

Param name Description
name
optional

Allows you to filter/search trucking companies by name

Validations:

  • Must be a String

code
optional

Allows you to filter/search trucking companies by codes (e.g. SCAC codes)

Validations:

  • Must be a String

general_ledger_id
optional

Allows you to filter/search trucking companies by general ledger ID

Validations:

  • Must be a String

missing_general_ledger_id
optional

Set to true to return all trucking companies that do not have a general ledger ID

Validations:

  • Must be a String

active
optional

Filter for active trucking companies by setting to true. Or set to false to get all inactive trucking companies. If absent, Octopi will return both active and inactive trucking companies.

Validations:

  • Must be a String

page
optional

Specify which page of results to fetch. This value defaults to 1.

Validations:

  • Must be a Integer

per
optional

The number of items to be displayed. This value defaults to 10 and accepts a maximum of 100.

Validations:

  • Must be a Integer


GET /api/v1/trucking_companies/:id
Returns information about a trucking company

This API endpoint will return the information for the trucking company.

Supported Formats

json

Errors

Code Description
400 Bad Request.
404 Not Found.
500 Internal Server Error.

Examples

curl "https://app.octopi.co/api/v1/trucking_companies/5.json" -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE"
{
   "trucking_company" : {
      "phone" : null,
      "name" : "FC OCTOPI",
      "id" : 337395,
      "general_ledger_id" : null,
      "vat_number" : null,
      "address" : null,
      "contact_person" : null,
      "code" : null,
      "email" : null
   }
}

Params

Param name Description
id
required

Validations:

  • Must be a Integer


POST /api/v1/trucking_companies
Create a new trucking company

This API endpoint allows you to create a new trucking company.

Supported Formats

json

Errors

Code Description
400 Bad Request.
404 Not Found.
500 Internal Server Error.

Examples

curl "https://app.octopi.co/api/v1/trucking_companies.json" -X POST -d '{ "name" : "FC UNITED", "general_ledger_id": "SL1231", "contact_person": "Joe Jones", "address": "123 Main St", "email": "joe@example.com", "code": "111", "vat_number": "223"}' -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE"
{
   "trucking_company" : {
      "email" : "joe@example.com",
      "id" : 353388,
      "general_ledger_id" : "SL1231",
      "phone" : "786-111-1111",
      "code" : "SCAC",
      "vat_number" : "223",
      "address" : "123 Main St",
      "contact_person" : "Joe Jones",
      "name" : "FC UNITED"
   }
}

PUT /api/v1/trucking_companies/:id
Updates a trucking company record

This API endpoint allows you to update a trucking company.

Supported Formats

json

Errors

Code Description
400 Bad Request.
404 Not Found.
500 Internal Server Error.

Examples

curl "https://app.octopi.co/api/v1/trucking_companies/353388.json" -X PUT -d '{ "name" : "FC UNITED LLC", "code": "222" , "vat_number": "223"}' -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE"
{
   "trucking_company" : {
      "code" : "222",
      "contact_person" : "Joe Jones",
      "phone" : null,
      "general_ledger_id" : "SL1231",
      "name" : "FC UNITED LLC",
      "vat_number" : "223",
      "address" : "123 Main St",
      "email" : "joe@example.com",
      "id" : 353388
   }
}

Params

Param name Description
id
required

Validations:

  • Must be a String


DELETE /api/v1/trucking_companies/:id
Soft deletes a trucking company record

This API endpoint allows you to delete a trucking company. This is a soft delete. It will mark the company as inactive.

Supported Formats

json

Errors

Code Description
400 Bad Request.
404 Not Found.
500 Internal Server Error.

Examples

curl "https://app.octopi.co/api/v1/trucking_companies/353388.json" -X DELETE -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE"
{
   "trucking_company" : {
      "contact_person" : null,
      "phone" : null,
      "email" : null,
      "code" : null,
      "name" : "A+ TIRE",
      "vat_number" : null,
      "address" : "DELMAS 19, RUE PIERRE ANSELME",
      "id" : 300009,
      "general_ledger_id" : null
   }
}

Params

Param name Description
id
required

Validations:

  • Must be a String