Use this API resource to CRUD freight forwarders.

Supported Formats

json

GET /api/v1/freight_forwarders.json
Returns the list of freight forwarders

This API endpoint will allow you to get a list of freight forwarders. 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/freight_forwarders.json?name=Octopi" -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE"
{
   "freight_forwarders" : [
      {
         "phone" : null,
         "name" : "FC OCTOPI",
         "general_ledger_id" : null,
         "vat_number" : "222",
         "email" : null,
         "id" : 337395,
         "address" : null,
         "contact_person" : null
      },
      {
         "address" : null,
         "contact_person" : null,
         "id" : 337386,
         "email" : null,
         "general_ledger_id" : null,
         "vat_number" : "2232",
         "phone" : null,
         "name" : "INTER OCTOPI"
      },
      {
         "email" : null,
         "general_ledger_id" : null,
         "vat_number" : "2212",
         "phone" : null,
         "name" : "OCTOPI UNITED FC",
         "address" : null,
         "contact_person" : null,
         "id" : 337385
      }
   ]
}

Params

Param name Description
name
optional

Allows you to filter/search freight forwarders by name

Validations:

  • Must be a String

general_ledger_id
optional

Allows you to filter/search freight forwarders by general ledger ID

Validations:

  • Must be a String

missing_general_ledger_id
optional

Set to true to return all freight forwarders that do not have a general ledger ID

Validations:

  • Must be a String

active
optional

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

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/freight_forwarders/:id
Returns information about a freight forwarder

This API endpoint will return the information for the freight forwarder.

Supported Formats

json

Errors

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

Examples

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

Params

Param name Description
id
required

Validations:

  • Must be a Integer


POST /api/v1/freight_forwarders
Create a new freight forwarder

This API endpoint allows you to create a new freight forwarder.

Supported Formats

json

Errors

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

Examples

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

PUT /api/v1/freight_forwarders/:id
Updates a freight forwarder record

This API endpoint allows you to update a freight forwarder.

Supported Formats

json

Errors

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

Examples

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

Params

Param name Description
id
required

Validations:

  • Must be a String


DELETE /api/v1/freight_forwarders/:id
Soft deletes a freight forwarder record

This API endpoint allows you to delete a freight forwarder. 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/freight_forwarders/353388.json" -X DELETE -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE"
{
   "freight_forwarder" : {
      "contact_person" : null,
      "phone" : null,
      "email" : 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