Supported Formats

json

GET /api/v1/consignees
Returns the list of consignees

This API endpoint will allow you to get a list of consignees. You can filter using a search query parameter passed in q.

Supported Formats

json

Errors

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

Examples

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

Params

Param name Description
name
optional

Allows you to filter/search consignees by name

Validations:

  • Must be String

general_ledger_id
optional

Allows you to filter/search consignees by general ledger ID

Validations:

  • Must be String

page
optional

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

Validations:

  • Must be Integer

per
optional

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

Validations:

  • Must be Integer


GET /api/v1/consignees/:id
Returns information about a consignee

This API endpoint will return the information for the consignee.

Supported Formats

json

Errors

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

Examples

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

Params

Param name Description
id
required

Validations:

  • Must be Integer


POST /api/v1/consignees
Create a new consignee

This API endpoint allows you to create a new consignee.

Supported Formats

json

Errors

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

Examples

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

PUT /api/v1/consignees/:id
Updates a consignee record

This API endpoint allows you to update a consignee.

Supported Formats

json

Errors

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

Examples

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

Params

Param name Description
id
required

Validations:

  • Must be String


DELETE /api/v1/consignees/:id
Delete a consignee record

This API endpoint allows you to delete a consignee.

Supported Formats

json

Errors

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

Examples

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

Params

Param name Description
id
required

Validations:

  • Must be String