Create Order

POST /orders

Create a new order

application/json

Body

If the order uses the standard workflow (is_return is false), then the source_location should include the uuid of one of your account's locations.

If the order uses the return workflow (is_return is true), then the destination_location should include the uuid of one of your account's locations.

For packages, please check your account preferences for the measurement system your account is using (https://app.fleetrunnr.dev/settings/account)

  • The order ID generated from a third-party system such as a CRM, POS, or accounting software

  • customer object Required
    Hide customer attributes Show customer attributes
  • source_location object Required
    Hide source_location attributes Show source_location attributes
  • Hide source_contact attributes Show source_contact attributes
    • name string
    • email string(email)
    • phone string(phone)

      Contact's phone number in E.164 international format

  • destination_location object Required
    Hide destination_location attributes Show destination_location attributes
  • Hide destination_contact attributes Show destination_contact attributes
    • name string
    • email string(email)
    • phone string(phone)

      Contact's phone number in E.164 international format

  • collections array[object]
    Hide collections attributes Show collections attributes
    • type string

      Collection's payment method

      Values are CASH, CHEQUE, or CREDIT_CARD.

    • amount number

      Minimum value is 0.

    • currency string

      Currency in ISO-3 format

  • packages array[object] Required
    Hide packages attributes Show packages attributes
    • name string
    • barcode string

      The unique barcode for this package

    • type string

      Values are ENVELOPE, BAG, or BOX.

    • width number

      Minimum value is 0.

    • length number
      • Imperial System: in
      • Metric System: cm

      Minimum value is 0.

    • height number
      • Imperial System: in
      • Metric System: cm

      Minimum value is 0.

    • weight number

      Minimum value is 0.

    • quantity number

      Values are cm or in.

  • requirements array[string]

    Values are cooler, freezer, narcotics, heater, pos_machine, driver_assistant, or lift.

  • Hide proof_of_delivery attributes Show proof_of_delivery attributes
    • signature boolean

      Indicate whether to require a signature upon delivery

    • image boolean

      Indicate whether to require a picture to be taken upon delivery

  • Hide pickup_schedule attributes Show pickup_schedule attributes
    • from string(date-time)

      Should be in UTC timezone

      Format should match the following pattern: YYYY-MM-DD HH:MM.

    • to string(date-time)

      Should be in UTC timezone

      Format should match the following pattern: YYYY-MM-DD HH:MM.

  • Hide delivery_schedule attributes Show delivery_schedule attributes
    • from string(date-time)

      Should be in UTC timezone

      Format should match the following pattern: YYYY-MM-DD HH:MM.

    • to string(date-time)

      Should be in UTC timezone

      Format should match the following pattern: YYYY-MM-DD HH:MM.

  • is_return boolean

    Indicates that the order is using the return workflow (sourced from a customer)

  • notes string
  • tags array[string]

    Order Tags (array of strings)

Responses

POST /orders
curl \
 -X POST https://{workspace}.fleetrunnr.com/api/v1/orders \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"external_id":"XYZ987","customer":{"external_id":"ABCDE12345","first_name":"John","last_name":"Ondricka","email":"john.ondricka@example.com","phone":"+12163547758","notes":"Some notes here..."},"source_location":{"uuid":"27df9695-5565-4091-b888-ca321b8566ff"},"source_contact":{"name":"Amanda Murrin","email":"amanda.murrin@example.com","phone":"+12025550159"},"destination_location":{"name":null,"line_1":"4840 Sun Valley Road","line_2":"Flat 302","city":"Prescott","region":"Washington","country":"US","zip_code":"99348","coordinates":{"lat":46.371826,"lng":-118.496391}},"destination_contact":{"name":"John Ondricka","email":"john.ondricka@example.com","phone":"+12163547758"},"collections":[{"amount":120.75,"currency":"USD","type":"CASH"}],"packages":[{"external_id":"12hj","barcode":"383176549899173888","type":"PARCEL","length":20,"width":30,"height":1,"weight":0.25,"quantity":1}],"requirements":["narcotics"],"proof_of_delivery":{"signature":true,"image":false},"pickup_schedule":{"from":"2022-01-20 13:30","to":"2022-01-20 15:00"},"delivery_schedule":{"from":"2022-01-23 09:00","to":"2022-01-23 11:30"},"is_return":false,"notes":"These notes are internal and not visible to customers...","tags":["tag1","tag2"]}'
{
  "external_id": "XYZ987",
  "customer": {
    "external_id": "ABCDE12345",
    "first_name": "John",
    "last_name": "Ondricka",
    "email": "john.ondricka@example.com",
    "phone": "+12163547758",
    "notes": "Some notes here..."
  },
  "source_location": {
    "uuid": "27df9695-5565-4091-b888-ca321b8566ff"
  },
  "source_contact": {
    "name": "Amanda Murrin",
    "email": "amanda.murrin@example.com",
    "phone": "+12025550159"
  },
  "destination_location": {
    "name": null,
    "line_1": "4840 Sun Valley Road",
    "line_2": "Flat 302",
    "city": "Prescott",
    "region": "Washington",
    "country": "US",
    "zip_code": "99348",
    "coordinates": {
      "lat": 46.371826,
      "lng": -118.496391
    }
  },
  "destination_contact": {
    "name": "John Ondricka",
    "email": "john.ondricka@example.com",
    "phone": "+12163547758"
  },
  "collections": [
    {
      "amount": 120.75,
      "currency": "USD",
      "type": "CASH"
    }
  ],
  "packages": [
    {
      "external_id": "12hj",
      "barcode": "383176549899173888",
      "type": "PARCEL",
      "length": 20,
      "width": 30,
      "height": 1,
      "weight": 0.25,
      "quantity": 1
    }
  ],
  "requirements": [
    "narcotics"
  ],
  "proof_of_delivery": {
    "signature": true,
    "image": false
  },
  "pickup_schedule": {
    "from": "2022-01-20 13:30",
    "to": "2022-01-20 15:00"
  },
  "delivery_schedule": {
    "from": "2022-01-23 09:00",
    "to": "2022-01-23 11:30"
  },
  "is_return": false,
  "notes": "These notes are internal and not visible to customers...",
  "tags": [
    "tag1",
    "tag2"
  ]
}
{
  "external_id": "XYZ987",
  "customer": {
    "uuid": "69e93118-a581-4a13-afea-b6d4a2d2c40c"
  },
  "source_location": {
    "uuid": "27df9695-5565-4091-b888-ca321b8566ff"
  },
  "source_contact": {
    "name": "Amanda Murrin",
    "email": "amanda.murrin@example.com",
    "phone": "+12025550159"
  },
  "destination_location": {
    "uuid": "84e249df-8d50-4212-8329-6059fc002563"
  },
  "destination_contact": {
    "name": "John Ondricka",
    "email": "john.ondricka@example.com",
    "phone": "+12163547758"
  },
  "collections": [
    {
      "amount": 120.75,
      "currency": "USD",
      "type": "CASH"
    }
  ],
  "packages": [
    {
      "external_id": "12hj",
      "barcode": "383176549899173888",
      "type": "PARCEL",
      "length": 20,
      "width": 30,
      "height": 1,
      "weight": 0.25,
      "quantity": 1
    }
  ],
  "requirements": [
    "heater"
  ],
  "proof_of_delivery": {
    "signature": true,
    "image": false
  },
  "pickup_schedule": {
    "from": "2022-01-20 13:30",
    "to": "2022-01-20 15:00"
  },
  "delivery_schedule": {
    "from": "2022-01-23 09:00",
    "to": "2022-01-23 11:30"
  },
  "is_return": false,
  "notes": "These notes are internal and not visible to customers...",
  "tags": [
    "tag1",
    "tag2"
  ]
}
Response examples (200)
{
  "message": "success",
  "data": {
    "order_uuid": "e56795c7-0bc3-4742-a52f-988d2af8608f",
    "order_number": "520025509673828352"
  }
}