Supported Formats

json

Errors

Code Description
404 Resource Not Found
422 Validation Error
500 Internal Server Error

Examples

curl 'https://app.octopi.co/api/v1/service_orders' \
  -X 'POST' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Token token=YOURTOKEN' \
  -d '{
    "service_order": {
      "order_number": "API_TEST_002",
      "cargo_type": "container",
      "due_at": "2024-05-20T00:00:00Z",
      "comment": "New SO",
      "container_ids": [
        4337700
      ],
      "service_ids": [
        "cleaning",
        721
      ]
    }
  }'
{
  "id": 41,
  "order_number": "API_TEST_002",
  "due_at": "2024-05-19T20:00:00-04:00",
  "cargo_type": "container",
  "status": "pending",
  "comment": "New SO",
  "created_at": "2024-01-29T05:33:55-05:00",
  "ordered_by": "System",
  "service_order_items": [
    {
      "id": 74,
      "container_id": 4337700,
      "status": "pending",
      "container_number": "0317933",
      "service_type": "custom",
      "service_id": 721,
      "service_name": "Repainting"
    },
    {
      "id": 75,
      "container_id": 4337700,
      "status": "pending",
      "container_number": "0317933",
      "service_type": "default",
      "service_id": "cleaning",
      "service_name": "Cleaning (Default)"
    }
  ]
}

Params

Param name Description
service_order
optional

Validations:

  • Must be a Hash

service_order[order_number]
required

The unique service order number given while creating one.

Validations:

  • Must be a String

service_order[cargo_type]
required

container or breakbulk

Validations:

  • Must be one of: container, vehicle, breakbulk.

service_order[container_ids]
required

Octopi IDs of containers.

Validations:

  • Must be an array of Integer

service_order[service_ids]
required

Array of default & custom service type IDs provided by Octopi.

Validations:

  • Must be an array of any type