POST
/
v1
/
orders
curl --request POST \
  --url https://sandbox.api.24hourinspections.com/v1/orders \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Property inspection",
  "description": "Description of the property inspection order",
  "external_id": "project123",
  "assessments": [
    {
      "location": "123 Main St, City, State, 12345",
      "asset_type_id": "dcd4a1f2-cb8d-4bc6-946d-bae706fb1f35",
      "assessment_type_id": "1d28a3e1-31fa-4e76-bb84-11094bca21a4",
      "responsible_party": {
        "name": "John Doe",
        "phone": "+1-234-567-8900",
        "email": "johndoe@example.com"
      },
      "camera_holder": {
        "name": "Jane Smith",
        "phone": "+1-234-567-8900",
        "email": "janesmith@example.com"
      },
      "attachment": [
        {
          "type": "SCOPE_OF_WORK",
          "value": "data:image/png;base64,...",
          "content_type": "Base64",
          "filename": "scope_of_work.pdf"
        }
      ],
      "external_id": "loan123",
      "notes": "Access information or specific instructions",
      "noOfUnits": 5,
      "webhook": {
        "url": "https://example.com/webhook",
        "trigger": "any_state_change"
      },
      "metadata": {}
    }
  ]
}'
{
  "_links": {
    "_assessments": [
      "/v1/orders/IOM-12086",
      "/v1/orders/IOM-12088"
    ]
  }
}

Overview

The request payload should include all necessary details about the order, such as the location, assessment types, responsible party information, metadata, and any attachments related to the order. The order may contain multiple assessments and attachments based on the assessment type.

Key Details

  • Assessments: Each order can have one or more assessments. An assessment must include key information such as the location, asset type, assessment type, and responsible party.
  • Required Attachment: If the assessment_type is Draw, a SCOPE_OF_WORK attachment is required. This attachment should contain details like budgets, funding, and requested amounts for the work.
  • Attachments: Attachments are optional but may be included depending on the assessment_type.
    • The allowed attachment types are:
      • JSON: Structured data (e.g., scope of work details like budget, funding, and requested amounts).
      • URL: A link to an external resource (such as an image or document related to the assessment).
      • Base64: Encoded binary data, suitable for including files or images directly in the request.
  • Webhook: Optionally, a webhook URL can be specified to receive real-time notifications for events related to this order. This URL will be triggered when the status of the order changes or updates are available.
  • Metadata: The metadata field allows for external metadata to be added to the order in the form of key-value pairs. This can be useful for tracking additional information or enabling filtering of orders based on the metadata provided. For example, metadata could include custom identifiers or details that help the customer categorize or track orders.

Allowed Content Types for Attachments:

  • JSON: Used for structured data (e.g., scope of work details, including budget and requested amounts). Example:
    [
        {
            "description": "Plumbing rough-in",
            "budget": 5000,
            "funded": 4000,
            "requested": 1000
        },
        {
            "description": "Roof",
            "budget": 4000,
            "funded": 4000,
            "requested": 0
        }
    ]
    
  • URL: A link to an external resource, such as an image or document related to the assessment.
  • Base64: Encoded binary data, typically used for including files or images directly within the request.

Please Note: If the assessment_type is Draw, a SCOPE_OF_WORK attachment is required.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
assessments
object[]
required

List of assessments for the order

name
string

Name of the order

Example:

"Property inspection"

description
string

Description of the order

Example:

"Description of the property inspection order"

external_id
string

External ID of the order

Example:

"project123"

Response

201 - application/json
Create new order

Links related to the order