This resource allows you to create, read, update, or delete shipping lines in Octopi.

Supported Formats

json

GET /api/v1/shipping_lines.json
Returns a list of shipping lines.

This API endpoint will return the information about all shipping lines.

Supported Formats

json

Errors

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

Examples

curl "https://app.octopi.co/api/v1/shipping_lines.json" -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE" -d '{"name":"ship"}'
{
   "actions" : {
      "previous" : {
         "url" : "https://app.octopi.co/api/v1/shipping_lines?page=0",
         "method" : "GET"
      },
      "next" : {
         "url" : "https://app.octopi.co/api/v1/shipping_lines?page=2",
         "method" : "GET"
      },
      "last" : {
         "method" : "GET",
         "url" : "https://app.octopi.co/api/v1/shipping_lines?page=1"
      },
      "index" : {
         "url" : "https://app.octopi.co/api/v1/shipping_lines",
         "method" : "GET"
      }
   },
   "shipping_lines" : [
      {
         "receive_email_alerts_on_container_damages" : false,
         "synonyms" : [],
         "email" : "",
         "name" : "shipping line name",
         "code" : "CODE",
         "dock_receipt_email" : null,
         "contact_person" : "",
         "phone" : "",
         "vat_number" : null,
         "empty_container_storage_teu_quota" : null,
         "parent" : {
            "id" : 20,
            "carrier_type" : "ocean",
            "name" : "parent shipping line",
            "synonyms" : [
               "CAT"
            ],
            "code" : "PARENTCODE"
         },
         "edi_settings": {
            "id": 64,
            "edi_partner": {
                "id": 22,
                "name": "SEA",
                "edi_id": null
            },
            "name": null,
            "entity_edi_id": null,
            "communication_mode": "smtp",
            "time_zone": "timezone",
            "default_sender_id": "",
            "sender_edi_id": "",
            "edi_carrier_id": "",
            "edi_standard": "edifact"
         },
         "general_ledger_id" : "SL22",
         "id" : 22,
         "address" : "address",
         "carrier_type" : "ocean"
      }
   ]
}

Params

Param name Description
name
optional

Allows you to filter/search shipping lines by name or part of the name.

Validations:

  • Must be a String

code
optional

Allows you to filter/search shipping lines by full code.

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/shipping_lines/:id
Returns information about a shipping line.

This API endpoint will return the information about a shipping line.

Supported Formats

json

Errors

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

Examples

curl "https://app.octopi.co/api/v1/shipping_lines/:id" -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE"
{
   "shipping_line" : {
      "address" : "address",
      "carrier_type" : "ocean",
      "name" : "shipping line name",
      "id" : 22,
      "email" : "",
      "contact_person" : "",
      "phone" : "",
      "empty_container_storage_teu_quota" : null,
      "parent" : {
         "carrier_type" : "ocean",
         "synonyms" : [
            "CAT",
            "CLA"
         ],
         "name" : "parent shipping line",
         "id" : 20,
         "code" : "PARENTCODE"
      },
      "edi_settings": {
         "id": 64,
         "edi_partner": {
             "id": 22,
             "name": "SEA",
             "edi_id": null
         },
         "name": null,
         "entity_edi_id": null,
         "communication_mode": "smtp",
         "time_zone": "timezone",
         "default_sender_id": "",
         "sender_edi_id": "",
         "edi_carrier_id": "",
         "edi_standard": "edifact"
      },
      "vat_number" : null,
      "receive_email_alerts_on_container_damages" : false,
      "synonyms" : [],
      "dock_receipt_email" : null,
      "general_ledger_id" : "SL22",
      "code" : "CODE"
   }
}

Params

Param name Description
id
required

You must pass the shipping line’s Octopi ID or shipping line’s code.

Validations:

  • Must be a String


POST /api/v1/shipping_lines.json
Creates a new shipping line.

This API endpoint allows you to create a new shipping line.

Supported Formats

json

Errors

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

Examples

curl "https://app.octopi.co/api/v1/shipping_lines.json" -X POST -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE" -d '{"shipping_line" : {"name" : "shipping line name", "code" : "CODE", "email" : "email@gmail.com", "general_ledger_id" : "M001", "address" : "address"}}'
{
   "shipping_line" : {
      "contact_person" : "contact_person",
      "dock_receipt_email" : null,
      "id" : 1271,
      "empty_container_storage_teu_quota" : null,
      "address" : "address",
      "receive_email_alerts_on_container_damages" : false,
      "carrier_type" : "ocean",
      "code" : "CODE",
      "email" : "email@gmail.com",
      "phone" : null,
      "general_ledger_id" : "M001",
      "vat_number" : null,
      "name" : "shipping line name",
      "synonyms" : []
   }
}

Params

Param name Description
shipping_line
required

Validations:

  • Must be a Hash

shipping_line[code]
required

Validations:

  • Must be a String

shipping_line[carrier_type]
optional

Pass carrier type among ocean, rail, air, or truck.

Validations:

  • Must be a String

shipping_line[address]
optional

Validations:

  • Must be a String

shipping_line[parent_id]
optional

If there is a parent shipping line, pass it’s Octopi ID.

Validations:

  • Must be a Integer

shipping_line[email]
optional

Validations:

  • Must be a String

shipping_line[contact_person]
optional

Validations:

  • Must be a String

shipping_line[phone]
optional

Validations:

  • Must be a String

shipping_line[receive_email_alerts_on_container_damages]
optional

Validations:

  • Must be one of: true, false.

shipping_line[vat_number]
optional

Validations:

  • Must be a String

shipping_line[general_ledger_id]
optional

Validations:

  • Must be a String

shipping_line[dock_receipt_email]
optional

Validations:

  • Must be a String

shipping_line[empty_container_storage_teu_quota]
optional

Validations:

  • Must be a Integer

shipping_line[synonyms]
optional

Validations:

  • Must be an array of any type


PUT /api/v1/shipping_lines/:id
Updates a shipping line record.

This API endpoint allows you to update a shipping line.

Supported Formats

json

Errors

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

Examples

curl "https://app.octopi.co/api/v1/shipping_lines/:id" -X PUT -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE" -d '{"shipping_line" : {"name" : "new shipping line name", "code" : "NEWCODE", "email" : "email@gmail.com", "general_ledger_id" : "M001", "address" : "address"}}'
{
   "shipping_line" : {
      "code" : "NEWCODE",
      "contact_person" : "contact_person",
      "synonyms" : [],
      "general_ledger_id" : "M001",
      "carrier_type" : "ocean",
      "name" : "new shipping line name",
      "phone" : null,
      "dock_receipt_email" : null,
      "email" : "email@gmail.com",
      "receive_email_alerts_on_container_damages" : false,
      "address" : "address",
      "vat_number" : null,
      "empty_container_storage_teu_quota" : null,
      "edi_settings": {
         "id": 64,
         "edi_partner": {
             "id": 22,
             "name": "SEA",
             "edi_id": null
         },
         "name": null,
         "entity_edi_id": null,
         "communication_mode": "smtp",
         "time_zone": "timezone",
         "default_sender_id": "",
         "sender_edi_id": "",
         "edi_carrier_id": "",
         "edi_standard": "edifact"
      },
      "id" : 1271
   }
}

Params

Param name Description
id
required

Validations:

  • Must be a String

shipping_line
required

Validations:

  • Must be a Hash

shipping_line[code]
required

Validations:

  • Must be a String

shipping_line[carrier_type]
optional

Pass carrier type among ocean, rail, air, or truck.

Validations:

  • Must be a String

shipping_line[address]
optional

Validations:

  • Must be a String

shipping_line[parent_id]
optional

If there is a parent shipping line, pass it’s Octopi ID.

Validations:

  • Must be a Integer

shipping_line[email]
optional

Validations:

  • Must be a String

shipping_line[contact_person]
optional

Validations:

  • Must be a String

shipping_line[phone]
optional

Validations:

  • Must be a String

shipping_line[receive_email_alerts_on_container_damages]
optional

Validations:

  • Must be one of: true, false.

shipping_line[vat_number]
optional

Validations:

  • Must be a String

shipping_line[general_ledger_id]
optional

Validations:

  • Must be a String

shipping_line[dock_receipt_email]
optional

Validations:

  • Must be a String

shipping_line[empty_container_storage_teu_quota]
optional

Validations:

  • Must be a Integer

shipping_line[synonyms]
optional

Validations:

  • Must be an array of any type