Get Order
Orders are made by organizations to fund tree planting or other biodiversity work, all tracked as "units". When the number of orderedUnits has been met with the same number of allocatedUnits, the order will be considered fulfilled. You may find an order has units allocated, and its up to the end user if they want to take these units now, or wait until the order is fulfilled. Use the ID to ensure you are getting unique units.
GET
/orders/{order}
curl \
-X GET https://api.protect.earth/orders/53f7bd7b-2ee2-4be4-a15b-e09c76a150f9
Response examples (200)
{
"id": "string",
"brand": "string",
"type": "manual",
"source": "corporate",
"status": "incomplete",
"receivedOn": "2024-05-04T09:42:00+00:00",
"fulfilledOn": "2024-05-04T09:42:00+00:00",
"organization": {
"id": "string",
"name": "string",
"logo": "string"
},
"plantedByName": "string",
"plantedForName": "string",
"personalisedCertificateMessage": "string",
"personalisedEmailMessage": "string",
"unitType": "tree",
"orderedUnits": 600,
"allocatedUnits": [
{
"id": "o2j",
"unitType": "tree",
"location": {
"latitude": 51.87351,
"longitude": -1.90973,
"name": "Hawling, England",
"what3words": "headlight.hunches.heads"
},
"photos": [],
"species": "Silver Birch",
"plantedOn": "2021-12-26T15:20:42.000000Z"
}
]
}
Response examples (404)
{
"type": "https://protect.earth/probs/something-went-wrong",
"title": "You do not have enough credit.",
"status": 400,
"detail": "Your current balance is 30, but that costs 50.",
"instance": "/account/12345/msgs/abc"
}