Ordering & Delivery

Introduction

With this new ordering service, there is no longer a concept of individual asset activation. Instead, you create an order for a "bundle" of products with these constituents in the payload: products (required: item_id, item_type, product_bundle) toolchain (optional: "Raster Toolkit" operation(s) applied to the products) notification (optional: webhook notification) delivery (optional: direct delivery to cloud storage)

A typical workflow is to Create Order and then use the Order ID to see the status of the order. Although the last step isn't required if you are utilizing webhook notifications.

Higher level API workflow

Ordering data

Simple bulk ordering

A simple bulk order consists of multiple items of the same item_type and product_bundle. You must specify the items in your order with an array of item_ids. Note: a bundle includes all the ancillary data associated with that product-- a Usable Data Map (UDM) or an XML metadata file, for example. A valid product_bundle field depends on the item_type.

POST Request

{  
   "name":"simple order",
   "products":[
      {  
         "item_ids":[  
            "20151119_025740_0c74",
            "20151119_025741_0c74"
         ],
         "item_type":"PSScene4Band",
         "product_bundle":"analytic"
      }
   ]
}

In this example, your response will look like this:

{
    "created_on": "2018-01-09T19:11:51.566Z",
    "id": "66139753-60e4-4926-a8ad-c556048aabce",
    "last_message": "Preparing order",
    "last_modified": "2018-01-09T19:11:51.566Z",
    "name": "simple order",
    "products": [
        {
            "item_ids": [
                "20151119_025740_0c74",
                "20151119_025741_0c74"
            ],
            "item_type": "PSScene4Band",
            "product_bundle": "analytic"
        }
    ],
    "state": "queued"
}

Using the order id in the initial response, you can get the status / result of your order:

Order Status URL: https://api.planet.com/compute/ops/orders/v2/66139753-60e4-4926-a8ad-c556048aabce

Order Result

{
  _links: {
    _self: "https://api.planet.com/compute/ops/orders/v2/66139753-60e4-4926-a8ad-c556048aabce",
    results: [{
        delivery: "success",
        name: "PSScene4Band/20151119_025741_0c74/analytic",
        expires_at: "0001-01-01T00:00:00.000Z",
        location: "DOWNLOAD_URL"
      },
      {
        delivery: "success",
        name: "PSScene4Band/20151119_025741_0c74/analytic_xml",
        expires_at: "0001-01-01T00:00:00.000Z",
        location: "DOWNLOAD_URL"
      },
      {
        delivery: "success",
        name: "PSScene4Band/20151119_025741_0c74/udm",
        expires_at: "0001-01-01T00:00:00.000Z",
        location: "DOWNLOAD_URL"
      },
      {
        delivery: "success",
        name: "PSScene4Band/20151119_025740_0c74/analytic",
        expires_at: "0001-01-01T00:00:00.000Z",
        location: "DOWNLOAD_URL"
      },
      {
        delivery: "success",
        name: "PSScene4Band/20151119_025740_0c74/analytic_xml",
        expires_at: "0001-01-01T00:00:00.000Z",
        location: "DOWNLOAD_URL"
      },
      {
        delivery: "success",
        name: "PSScene4Band/20151119_025740_0c74/udm",
        expires_at: "0001-01-01T00:00:00.000Z",
        location: "DOWNLOAD_URL"
      }
    ]
  },
  created_on: "2018-01-09T19:11:51.563Z",
  id: "66139753-60e4-4926-a8ad-c556048aabce",
  last_message: "Delivery completed",
  last_modified: "2018-01-09T21:41:09.170Z",
  name: "simple order",
  error_hints: [ ],
  products: [{
    item_ids: [
      "20151119_025740_0c74",
      "20151119_025741_0c74"
    ],
    item_type: "PSScene4Band",
    product_bundle: "analytic"
  }],
  state: "success"
}

Ordering multiple item types

To order multiple item types, follow the steps for a simple order of one item_type, and append an array for each additional item_type.

Multiple Item Types

{  
   "name":"multiple order",
   "products":[
      {  
         "item_ids":[  
            "20151119_025740_0c74",
            "20151119_025741_0c74"
         ],
         "item_type":"PSScene4Band",
         "product_bundle":"analytic"
      },
      {
        "item_ids": ["20171226_222055_6021709_RapidEye-3"],
        "item_type": "REOrthoTile",
        "product_bundle": "analytic"
  }
   ]
}

Fallback bundles

You may specify a “fallback” bundle option in the product_bundle field. A fallback bundle is a bundle that Orders will select if your first choice cannot be found. To specify a fallback bundle simply add the alternate bundle(s) to the product_bundle field separated by commas.

{
  "name": "Simple order with fallback options",
  "products": [
    {
      "item_ids": [
        "20170614_113217_3163208_RapidEye-5"
      ],
      "item_type": "REOrthoTile",
      "product_bundle": "analytic"
    },
    {
      "item_ids": [
        "20160603_130605_0c66"
      ],
      "item_type": "PSScene3Band",
      "product_bundle": "visual,analytic"
    },
    {
      "item_ids": [
        "20170716_144316_1041"
      ],
      "item_type": "PSScene4Band",
      "product_bundle": "analytic_udm2,analytic"
    }
  ]
}

In the above request "product_bundle": "analytic_udm2,analytic" is asking for an analytic_udm2 bundle, but if that can’t be found, it will accept an analytic bundle.

The order of precedence for fallback is left to right. This means Orders will try to select the left-most bundle first, and move right to the next one until all choices are exhausted.

The response for the above request demonstrates the selection. For PSScene3Band the first choice visual was available, so Orders selected that. However, for PSScene4Band the first choice analytic_udm2 was not available, so Orders selected the alternative, analytic.

{
  "_links": {
    "_self": "https://api.planet.com/compute/ops/orders/v2/d3f57529-1d0c-491d-93a6-6f60930b7c78"
  },
  "created_on": "2019-09-13T15:25:53.461Z",
  "error_hints": [],
  "id": "d3f57529-1d0c-491d-93a6-6f60930b7c78",
  "last_message": "Preparing order",
  "last_modified": "2019-09-13T15:25:53.461Z",
  "name": "Simple order with fallback options",
  "products": [
    {
      "item_ids": [
        "20170614_113217_3163208_RapidEye-5"
      ],
      "item_type": "REOrthoTile",
      "product_bundle": "analytic"
    },
    {
      "item_ids": [
        "20160603_130605_0c66"
      ],
      "item_type": "PSScene3Band",
      "product_bundle": "visual"
    },
    {
      "item_ids": [
        "20170716_144316_1041"
      ],
      "item_type": "PSScene4Band",
      "product_bundle": "analytic"
    }
  ],
  "state": "running"
}

Order types

Your access to assets in a product_bundle is determined by the permissions filter attached to your account. (Permission is based on your area of interest (AOI) or timeline of interest (TOI).) If you make a request for assets that you are not permitted to access, your entire order will fail. In this case, you have the following options:

  • remove from your order the product_bundle(s) you are not permitted to access and resubmit your order; or
  • use the order_type option in your request and set the order_type to partial. By default, order_type is full; setting the order_type to partial allows the order to succeed by ignoring any assets in the item_ids list for which an asset in the specified product_bundle is not available or fails a permission check.
{  
   "name":"partial order",
   "order_type": "partial", 
   "products":[]
}

Using webhooks

Specify a webhook URL to be notified when the order is ready. If delivery to cloud storage is not indicated, then the webhook will contain the URLs to the results.

Webhook Notification

{  
   "name":"basic order + notification",
   "products":[  
      {  
         "item_ids":[  
            "20151225_233020_0c74"
         ],
         "item_type":"PSScene4Band",
         "product_bundle":"analytic"
      }
   ],
   "notifications":{  
      "webhook":{  
         "url":"{URL}"
      }
   }
}

By default, webhooks will be issued for each delivered item. You can request a single per-order webhook by providing the per_order: true parameter.

   "notifications":{  
      "webhook":{  
         "per_order": true,
         "url":"{URL}"
      }
   }

Email notification

You can also flag that you want an email notification sent once the order is complete. You do this by setting the email field. Note that the notification will be sent to whichever email is associated with the API key used for authorization.

{  
   "name":"basic order + email notification",
   "products":[  
      {  
         "item_ids":[  
            "20151225_233020_0c74"
         ],
         "item_type":"PSScene4Band",
         "product_bundle":"analytic"
      }
   ],
   "notifications":{  
      "email": true
   }
}

Order state

The state field represents the state of your order. It will be presented as one of five possibilities:

  • queued - the order was accepted and is in the queue to run
  • running - the order is running
  • success - the order succeeded fully
  • failed - the order failed
  • partial - the order was partially fulfilled

A note about partially completed orders

When your order reports a partial state it means that processing has completed but not all assets could be delivered. This is likely due to a failure during delivery or some intermediate processing step. Refer to the error_hints field for specifics.

We retry all process steps multiple times but sometimes things just don't make it through in a timely fashion. We're always monitoring these partial orders and constantly adjusting to changing conditions. Some problems are internal and some are external with third-party services. If you see steady stream of partial orders, please reach out to your account manager and escalate the matter. We'll do our best to get an explanation and, ideally, fix the problem if possible.

Listing orders

You can view your orders by querying the following endpoint using your API key:

https://api.planet.com/compute/ops/orders/v2/

This will return a paged list of all your recent orders. You can also filter by the various states mentioned above by including the state query parameter. For example, to see all your orders in the failed state, you would send the following request:

https://api.planet.com/compute/ops/orders/v2/?state=failed

Delivery to cloud storage

You may choose to have your order delivered to either Amazon S3, Microsoft Azure Blob Storage or Google Cloud Storage. For any cloud storage provider, you will need to create an account with both write and delete access.

Delivery to Amazon S3

Parameters

bucket (string)

The name of the bucket that will receive the output from the order

aws_region (string)

The region where the bucket lives in AWS.

aws_access_key_id / aws_secret_access_key (string)

AWS credentials with write and delete access to the bucket. Generally this means your account must be given GetObject , PutObject , and DeleteObject permissions on the bucket.

path_prefix (string)

path_prefix is an optional string that will be prepended to the files delivered to the bucket. If you use the slash (/) character, S3 will treat this as a "folder". Any other characters will merely be a prefix to the files.

E.g. if you are delivering a file named 320170716_144316_1041_3B_AnalyticMS.tif and specify a path_prefix of /folder1/prefix- the result in S3 will look like

/folder1/prefix-320170716_144316_1041_3B_AnalyticMS.tif

Uploading to S3

{  
   "name":"simple order",
   "products":[
      {  
         "item_ids":[  
            "20151119_025740_0c74",
            "20151119_025741_0c74"
         ],
         "item_type":"PSScene3Band",
         "product_bundle":"analytic"
      }
   ],
   "delivery":{  
      "amazon_s3":{  
         "bucket":"foo-bucket",
         "aws_region":"us-east-2",
         "aws_access_key_id":"",
         "aws_secret_access_key":"",
         "path_prefix":""
      }
   }
}

Delivery to Microsoft Azure

For Azure delivery an 'account', 'container', and 'sas_token' must be provided, 'storage_endpoint_suffix' and 'path_prefix' are optional.

You will need to give your account write and delete access to the container. Typically this means setting a policy with Read, Write, Delete, and List permissions.

'sas_token' should be input without a leading '?'. It should look like "sv=2017-04-17u0026si=writersr=cu0026sig=LGqc" rather than "?sv=2017-04-17u0026si=writersr=cu0026sig=LGqc".

If you would like delivery to a sovereign cloud storage_endpoint_suffix should be set appropriately for your cloud. The default is "core.windows.net".

path_prefix is appended to all delivered files. It is not assumed to be a path, so if you would like to deliver to a folder path_prefix should have a trailing slash.

Uploading to Azure

{  
   "name":"simple order",
   "products":[  
      {  
         "item_ids":[  
            "20151119_025740_0c74",
            "20151119_025741_0c74"
         ],
         "item_type":"PSScene3Band",
         "product_bundle":"analytic"
      }
   ],
   "delivery":{  
      "azure_blob_storage":{  
         "account":"",
         "container":"",
         "sas_token":"",
         "storage_endpoint_suffix":"",
         "path_prefix":""
      }
   }
}

Delivery to Google Cloud Storage

Parameters

bucket (string)

The name of the bucket under GCS.

credentials (string)

GCS credentials with write and delete access to the bucket.

path_prefix (string)

Prefix that allows you to treat locations as "folders" under the bucket. See GCS list for more details.

Uploading to GCS

{
    "name": "simple gcs",
    "products": [
        {
            "item_ids": [
                "20170614_113217_3163208_RapidEye-5"
            ],
            "item_type": "REOrthoTile",
            "product_bundle": "analytic"
        },
        {
            "item_ids": [
                "20160603_130605_0c66"
            ],
            "item_type": "PSScene3Band",
            "product_bundle": "visual"
        },
        {
            "item_ids": [
                "20170716_144316_1041"
          },
    {
      "path": "files/PSScene4Band/20180205_181923_1031/analytic/20180205_181923_1031_metadata.json",
      "media_type": "application/json",
      "size": 892,
      "digests": {
        "md5": "976d1c0e86482fb16f08e222854a0ad9",
        "sha256": "d8989aafb5db27fa1323f7699de51b94f8819fa875a6a96ee978bfe4ff021c69"
      },
      "annotations": {
        "planet/item_id": "20180205_181923_1031",
        "planet/item_type": "PSScene4Band"
      }
      ],
            "item_type": "PSScene4Band",
            "product_bundle": "analytic"
        }
    ],
    "delivery": {
        "google_cloud_storage": {
            "bucket": "your-gcs-bucket",
            "credentials": "c29tZWNyZWRzZm9yeW91cmdjc2J1Y2...",
            "path_prefix": "some/folder/"
        }
    }
}

Preparing your Google Cloud Storage credentials

When you create your service account for access to your storage bucket, but sure to assign it the ability to Create and Delete resources. There are situations where we may need to deliver an asset more than once (due to retries on failures) and a copy-over is done via a delete and create by Google.

You should download your service account credentials in JSON format (not P12). To encode the json file as a base64 string you can use a cmdline operation such as

Preparing a GCS Credential

cat my_creds.json | base64 | tr -d '\n'

This will create a single-line base64 version of your service account credentials suitable for use by the credentials parameter.

Delivery Manifests

Your delivered data is described by one or more JSON manifests, which are delivered to your cloud storage location along with your order. Each manifest describes the locations of a set of delivered files along with some additional metadata, such as the size and cryptographic hash of file contents.

Manifests should be used to learn specifically to which paths data will be delivered.

This location is calculated by taking the provided path_prefix, if any, then appending the order ID, the package ID, then "manifest.json".

For example, the first package from an order with ID "68b2e5c0-aaf0-49cb-b5a8-13a96083dd41" containing a path prefix of "ordered_data/" would place a manifest at the following key:

/ordered_data/68b2e5c0-aaf0-49cb-b5a8-13a96083dd41/1/manifest.json

Note the /1/ part of that path. Each part of the order results will go in its own folder to avoid naming conflicts.

These paths are not guaranteed to be predictable or stable, so you must not rely on guessing where data might be located. It is guaranteed, however, that a manifest will be delivered to the root of the "package".

If this package contained an analytic product bundle, for example, the manifest contents might look like this:

Sample manifest.json

{
  "files": [
    {
      "path": "files/PSScene4Band/20180205_181923_1031/analytic/20180205_181923_1031_3B_AnalyticMS.tif",
      "media_type": "image/tiff",
      "size": 159628210,
      "digests": {
        "md5": "eccbc1ee8026a84264dc1470d1fee348",
        "sha256": "e3264ba1922113b769bb6b2db693e78ae3ca7617ffb599a657a8ee3964df0ba9"
      },
      "annotations": {
        "planet/asset_type": "analytic",
        "planet/bundle_type": "analytic",
        "planet/item_id": "20180205_181923_1031",
        "planet/item_type": "PSScene4Band"
      }
    },
    {
      "path": "files/PSScene4Band/20180205_181923_1031/analytic/20180205_181923_1031_3B_AnalyticMS_DN_udm.tif",
      "media_type": "image/tiff",
      "size": 1233463,
      "digests": {
        "md5": "d4fdeda23e47073a73d802740731c3bb",
        "sha256": "a225830664cbe1f5f1ed92c1101c893e89c8f8d9d88d83d9f4284b64811a909b"
      },
      "annotations": {
        "planet/asset_type": "udm",
        "planet/bundle_type": "analytic",
        "planet/item_id": "20180205_181923_1031",
        "planet/item_type": "PSScene4Band"
      }
    },
    {
      "path": "files/PSScene4Band/20180205_181923_1031/analytic/20180205_181923_1031_3B_AnalyticMS_metadata.xml",
      "media_type": "text/xml",
      "size": 10407,
      "digests": {
        "md5": "a2b24d7429217bbe1c3d3d4a00099d60",
        "sha256": "4b251c4544203d8282403d09d32ed1bdd71b03f0ae8516169ee05382062f7aac"
      },
      "annotations": {
        "planet/asset_type": "analytic_xml",
        "planet/bundle_type": "analytic",
        "planet/item_id": "20180205_181923_1031",
        "planet/item_type": "PSScene4Band"
      }
    }
  ]
}

To actually read the first file, strip "manifest.json" from the path of the first key, then append the value of the "path" field:

Final asset location:

/ordered_data/68b2e5c0-aaf0-49cb-b5a8-13a96083dd41/1/files/PSScene4Band/20180205_181923_1031/analytic/20180205_181923_1031_3B_AnalyticMS.tif

Why you should depend on the manifest file

Cloud storage delivery is "eventually consistent", meaning there may be a delay between the time at which an object is uploaded and when that object is accessible for download. Additionally, individual objects may arrive in any order. Even if a client depends on webhooks or another explicit notification, the cloud storage service may still impact the availability of data.

By looking for the manifest file first and then looking for the other files to appear, you can guarantee your pipeline will have everything it needs.

The metadata.json file

In addition to your requested assets, you may get a metadata.json file. This is a copy of the metadata associated with the asset from our catalog. The metadata.json will appear in the manifest like other assets but will not have planet/bundle_type or planet/asset_type annotations.

{
  "id": "20180204_152423_103e",
  "type": "Feature",
  "geometry": {
    "coordinates": [
      [
        [
          -80.66557928169364,
          28.438843302832705
        ],
        [
          -80.68288062074312,
          28.36602589486687
        ],
        [
          -80.42748137311838,
          28.31897078740344
        ],
        [
          -80.4104695544562,
          28.391931074041675
        ],
        [
          -80.66557928169364,
          28.438843302832705
        ]
      ]
    ],
    "type": "Polygon"
  },
  "properties": {
    "acquired": "2018-02-04T15:24:23.097646Z",
    "anomalous_pixels": 0,
    "cloud_cover": 0.1,
    "columns": 8894,
    "epsg_code": 32617,
    "ground_control": true,
    "gsd": 3.9,
    "instrument": "PS2",
    "item_type": "PSScene3Band",
    "origin_x": 531072,
    "origin_y": 3145863,
    "pixel_resolution": 3,
    "provider": "planetscope",
    "published": "2018-02-04T21:34:31Z",
    "quality_category": "standard",
    "rows": 4398,
    "satellite_id": "103e",
    "strip_id": "1141432",
    "sun_azimuth": 140.3,
    "sun_elevation": 35.3,
    "updated": "2018-02-04T22:08:49Z",
    "usable_data": 0,
    "view_angle": 0.9
  }
}

Zipping results

You can receive the output of your toolchain as a zip archive. This can either be "per bundle" where you get one zip archive per bundle you request or "per order," meaning you will get a single archive of the results of your order.

Parameters

archive_filename (string)

This is the name of the archive file you will receive. There are simple template variables available that you can include in the string. They are

{{name}} = Bundle Name {{order_id}} = Unique Order ID

unless you specify single_archive (see below) in which case

{{name}} = Order Name

archive_type (string)

Currently only zip format is supported.

single_archive (boolean)

This is an optional parameter, and is only necessary when you perform no "merge" operations (like tile or composite) but still want all of the bundles archived together as a single file.

Per bundle

The sample below demonstrates receiving one zip file per bundle:

{  
   "name":"simple order",
   "products":[  
      {  
         "item_ids":[  
            "20151119_025740_0c74",
            "20151119_025741_0c74"
         ],
         "item_type":"PSScene3Band",
         "product_bundle":"analytic"
      }
   ],
   "delivery":{  
      "archive_filename":"{{name}}_{{order_id}}.zip",
      "archive_type":"zip",
      "amazon_s3":{  
         "bucket":"import-staging",
         "aws_region":"us-west-2",
         "aws_access_key_id":"",
         "aws_secret_access_key":"",
         "path_prefix":"simpleorder"
      }
   }
}

Per order

The following sample demonstrates receiving a single zip of all the bundles requested:

{  
   "name":"simple order",
   "products":[  
      {  
         "item_ids":[  
            "20151119_025740_0c74",
            "20151119_025741_0c74"
         ],
         "item_type":"PSScene3Band",
         "product_bundle":"analytic"
      }
   ],
   "delivery":{
      "single_archive": true,
      "archive_filename":"{{name}}_{{order_id}}.zip",
      "archive_type":"zip",
      "amazon_s3":{  
         "bucket":"import-staging",
         "aws_region":"us-west-2",
         "aws_access_key_id":"",
         "aws_secret_access_key":"",
         "path_prefix":"simpleorder"
      }
   }
}

Cancelling Orders

We have provided a way to cancel "queued" Orders to prevent them from running. Once an Order has started running, we are unable to reliably cancel them. Let's look at some examples of how to do this.

Single Queued Order

To cancel a single Order, you can send an HTTP PUT request to the target resource. For example, if one wanted to cancel an Order with the ID f12bc37d-ffce-423e-9a9a-deb34a423b82, you would send the following request:

PUT https://api.planet.com/compute/ops/orders/v2/f12bc37d-ffce-423e-9a9a-deb34a423b82

A cURL example:

$ curl -iu $API_KEY: -XPUT https://api.planet.com/compute/ops/orders/v2/f12bc37d-ffce-423e-9a9a-deb34a423b82
HTTP/2 200 
...

This Order will now be in a cancelled state, the result of a GET request shows below.

{
  "_links": {
    "_self": "https://api.planet.com/compute/ops/orders/v2/f12bc37d-ffce-423e-9a9a-deb34a423b82"
  },
  "created_on": "2019-11-15T16:13:53.232Z",
  "error_hints": [],
  "id": "f12bc37d-ffce-423e-9a9a-deb34a423b82",
  "last_message": "Cancel success",
  "last_modified": "2019-11-15T16:16:00.512Z",
  "name": "test-single-cancel",
  "products": [
    {
      "item_ids": [
        "20160603_130605_0c66"
      ],
      "item_type": "PSScene3Band",
      "product_bundle": "visual"
    },
    {
      "item_ids": [
        "20191026_171453_0f17",
        "20191025_171719_0f25"
      ],
      "item_type": "PSScene4Band",
      "product_bundle": "analytic"
    }
  ],
  "state": "cancelled"
}

Bulk Cancel Orders

Especially due to the quantity of Orders that can be queued at any one time, we also provide a way to cancel Orders in bulk. Currently we support cancelling ALL queued Orders or specifying a list of Order IDs for which Orders you wish to cancel.

Note: Because of the asynchronous nature of the Ordering system, we cannot guarantee that all Orders that are in a "queued" state when the request is sent will be in that state when we try to service the HTTP request. Some may transition to a "running" state and no longer be in a cancellable state.

All Queued

To cancel all of your Orders in a "queued" state, you can POST an empty JSON object ({}) to https://api.planet.com/compute/ops/bulk/orders/v2/cancel. A cURL example is shown below.

$ curl -H 'Content-Type: application/json' -X POST -su $API_KEY: https://api.planet.com/compute/ops/bulk/orders/v2/cancel -d '{}' | jq .
{
  "result": {
    "failed": {
      "count": 0,
      "failures": []
    },
    "succeeded": {
      "count": 15
    }
  }
}

Specific Queued

If you happen to know the specific IDs of Orders you wish to cancel, you can supply them in the order_ids field of the JSON request. A request may look like the following.

{
   "order_ids": [
      "6031093e-90b7-4a94-9eb6-f3e5ca976a78",
      "dd2e95fa-a4bb-447f-93a1-44fe0ba80d3d",
      "04cf3dff-1774-4b2b-888d-a090de15023e",
      "08989bf2-8d9c-44d7-8b7d-f23d89ae2be9",
      "afe85e41-170f-40eb-8c98-c511e0814604",
      "34de3a40-ae7a-4904-abea-3aaf64f79e99"
   ]
}

Here is a cURL example showing what the response could look like, with the above request stored in cancelling.json.

$  curl -H 'Content-Type: application/json' -X POST -su $API_KEY: https://api.planet.com/compute/ops/bulk/orders/v2/cancel -d @cancelling.json | jq .
{
  "result": {
    "failed": {
      "count": 0,
      "failures": []
    },
    "succeeded": {
      "count": 6
    }
  }
}

If we cannot cancel an Order for some reason, we will provide a count of failed cancels and a message indicating why. The most common reason would be that the Order is not in a cancellable state. An example of what this might look like is below.

{
  "result": {
    "failed": {
      "count": 2,
      "failures": [
        {
          "message": "Order not in a cancellable state",
          "order_id": "bbe58d25-72d9-4968-b132-a8741c2ccd12"
        },
        {
          "message": "Order not in a cancellable state",
          "order_id": "267e17d5-ab3f-4f50-a90f-4f581d41892f"
        }
      ]
    },
    "succeeded": {
      "count": 10
    }
  }
}