Batch

Bulk-create plots.

Create multiple plots that share the same commodities. The plots will be owned by your business.

POSThttps://api.tradeaware.live-eo.com/plots/batch
Body
commodities*array of Commodity (enum)

What crops (among the relevant commodities) are grown on these fields (currently).

filenamestring

Filename used to upload Plots in batch.

geometries*object

The geometries of the Plots as key-value pairs. Each value should be a geometry. Each key is used to identify the geometry/plot in the response.

Response
Body
status*string

It describes the overall result of the batch operation.

Example: "PARTIAL_FAILURE"
errors*object

Index and error detail for failed Plots.

processed*object

Index and endpoints for Plots processed successfully.

Request
const response = await fetch('https://api.tradeaware.live-eo.com/plots/batch', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "commodities": [
        "oil palm",
        "rubber"
      ],
      "geometries": {
        "plot1": {
          "type": "Polygon",
          "coordinates": [
            [
              [
                30,
                10
              ],
              [
                40,
                40
              ],
              [
                20,
                40
              ],
              [
                10,
                20
              ],
              [
                30,
                10
              ]
            ]
          ]
        },
        "plot2": {
          "type": "MultiPolygon",
          "coordinates": [
            [
              [
                [
                  30,
                  20
                ],
                [
                  45,
                  40
                ],
                [
                  10,
                  40
                ],
                [
                  30,
                  20
                ]
              ]
            ],
            [
              [
                [
                  15,
                  5
                ],
                [
                  40,
                  10
                ],
                [
                  10,
                  20
                ],
                [
                  5,
                  10
                ],
                [
                  15,
                  5
                ]
              ]
            ]
          ]
        }
      }
    }),
});
const data = await response.json();
Response
{
  "status": "PARTIAL_FAILURE",
  "errors": {
    "some_index_0": "some detailed error"
  },
  "processed": {
    "some_index_0": "/plots/123"
  }
}

Last updated