POST /v2/orders/batch_create

Multiple orders can be created or updated at once via a POST request to https://api.shipup.co/v2/orders/batch_create.

Calling this endpoint will enqueue a job for later processing. You will find the job id in the response body. With this job_id you can use the view a job endpoint to retrieve information about the progress of your request. Alternatively, you'll find the path to the job endpoint in the location header.

Request payload:

FIELD

DESCRIPTION

orders
array of objects, required

An array of orders as described in the create or update an order endpoint specification.
The maximum allowed order count is 100.

Request example
{
  "orders": [
    {
      "merchant_id": "ORDER_MERCHANT_ID_SUCCESS",
      "order_number": "O_N_TEST5",
      "fulfillments": [
        {
          "merchant_id": "MY_FULFILLMENT_ID",
          "shipping_address": {
            "address1": "123 road street",
            "city": "City",
            "zip": "12345",
            "country": "Country"
          },
          "line_items": [
            {
              "merchant_id": "MY_UNSHIPPED_PRODUCT_ID"
            }
          ]
        }
      ]
    },
    {
      "order_number": "ORDER_NUMBER_FAILED",
      "fulfillments": [
        {
          "merchant_id": "MY_FULFILLMENT_ID",
          "shipping_address": {
            "address1": "123 road street",
            "city": "City",
            "zip": "12345",
            "country": {}
          },
          "line_items": [
            {
              "merchant_id": "MY_UNSHIPPED_PRODUCT_ID",
              "canceled": "true"
            }
          ]
        }
      ]
    }
  ]
}
// status
202

// body
{
  "job_id": 12456
}
{
  "job_id": 123123,
  "status": "completed",
  "queued_at": "DATE",
  "processed_at": "DATE",
  "completed_at": "DATE",
  "results": [
    {
      "status": 201,
      "body": {
        "merchant_id": "ORDER_MERCHANT_ID_SUCCESS"
      }
    },
    {
      "status": 400,
      "body": {
        "merchant_id": null,
        "errors": {
          "merchantId": "Required",
          "fulfillments": {
            "0": {
              "country": "Wrong data type: given, Hash ({}) expected: String",
              "line_items": {
                "0": {
                  "canceled": "Wrong data type: given, String (true) expected: TrueClass or FalseClass"
                }
              }
            }
          }
        }
      }
    }
  ],
  "payload": {
    "method": "POST",
    "url": "https://api.shipup.co/v2/orders",
    "body": {
      "orders": [
        {
          "merchant_id": "ORDER_MERCHANT_ID_SUCCESS",
          "order_number": "O_N_TEST5",
          "fulfillments": [
            {
              "merchant_id": "MY_FULFILLMENT_ID",
              "shipping_address": {
                "address1": "123 road street",
                "city": "City",
                "zip": "12345",
                "country": "Country"
              },
              "line_items": [
                {
                  "merchant_id": "MY_UNSHIPPED_PRODUCT_ID"
                }
              ]
            }
          ]
        },
        {
          "order_number": "ORDER_NUMBER_FAILED",
          "fulfillments": [
            {
              "merchant_id": "MY_FULFILLMENT_ID",
              "shipping_address": {
                "address1": "123 road street",
                "city": "City",
                "zip": "12345",
                "country": {}
              },
              "line_items": [
                {
                  "merchant_id": "MY_UNSHIPPED_PRODUCT_ID",
                  "canceled": "true"
                }
              ]
            }
          ]
        }
      ]
    }
  }
}