Get all your orders
Get a list of all of your orders. In the new API the currency in the order will match the currency specified in the order request.
Legend
❓ - clarification will be provided
⚪️ - discontinued
⏳ - TBD
🟡 - supported but requires changes
🟢 - supported
Request
Comparison
Term | Old API | New API |
---|---|---|
Endpoint | 🟢 GET /api/my-orders | 🟡 GET v1/orders |
Authorization | 🟢 Via t (required) | 🟡 Via the Authorization request header (required) |
Examples
curl --request GET \
--url 'https://sandbox.market-api.southpole.com/api/my-orders?t=token' \
--header 'Content-Type: application/json'
curl --request GET \
--url 'https://dcs-compensate-api-sandbox.southpole.com/v1/orders?pageSize=20&sort=CREATED_AT&dir=DESC' \
--header 'accept: application/json' \
--header 'authorization: Bearer token'
Cursor-pagination
The new API implemented cursor based pagination to list remote entries. All endpoints implementing listings return
nextPageToken
that can be passed into the query string parameternextPageToken
in the next API request.
Response
Comparison
Data Model (JSON path) | Old API | New API |
---|---|---|
Status | 🟢 status | ⚪️ Removed in favour of the HTTP client response status field |
Order ID | 🟢 orders[].id | 🟡 orders[].id |
Customer details | 🟢 orders[].name | 🟡 orders[].consumer.* |
Order status | 🟢 orders[].status | 🟡 orders[].status (RESERVED , CANCELLED , COMPLETED ) |
Gateway | 🟢 orders[].gateway | ⚪️ Removed |
Total amount | 🟢 orders[].totalAmount (in EUR) | 🟡 orders[].totalPrice.amount |
Currency | 🟢 orders[].currency | 🟡 orders[].totalPrice.currency |
EUR equivalent | 🟢 orders[].eur_equivalent | ⚪️ Removed in favour of a currency specified in the order request |
Created date time | 🟢 orders[].created_at | 🟡 orders[].createdAt |
Date paid | 🟢 orders[].date_paid | ⚪️ Removed |
Total credits | 🟢 orders[].total_credits | 🟡 orders[].totalVolume |
Compensated projects details | 🟢 orders[].projects[].* | 🟡 orders[].projects[].* (money and volume breakdown per project) |
Order notes | 🟢 orders[].nodes | ⚪️ Removed |
Examples
{
"status": "ok",
"orders": [
{
"id": 1556388118,
"name": "John Doe",
"msg": "Order Paid",
"status": "paid",
"gateway": "Stripe",
"total_amount": 10.67,
"currency": "EUR",
"eur_equivalent": 10.67,
"created_at": "2019-04-27 18:01:58",
"date_paid": "2019-04-27 18:01:58",
"total_credits": 0.97,
"projects": [
{
"no": 300758,
"name": "Za Hung Hydro",
"credits": 0.97
}
],
"notes": ""
},
{
"id": 1545485375,
"name": "Jane Doe",
"msg": "Order Paid",
"status": "paid",
"payment_processor": "PayPal",
"total_amount": 67.49,
"currency": "EUR",
"eur_equivalent": 67.49,
"created_at": "2018-12-22 12:29:35",
"date_paid": "2018-12-22 12:29:35",
"total_credits": 3.97,
"projects": [
{
"no": 300758,
"name": "Kariba Forest Protection",
"credits": 3.97
}
],
"notes": ""
}
]
}
{
"nextPageToken": "eyJsYXN0X2lkIjo0ODAyMjk2OTM4NjUzLCJsYXN0X3ZhbHVlIjoxNjc0MTM0NzkxMDAwfQ==",
"orders": [
{
"consumer": {
"firstName": "John",
"lastName": "Doe"
},
"createdAt": "2023-01-19T13:26:31Z",
"id": "4802296938653",
"projects": [
{
"contribution": {
"amount": "30",
"currency": "EUR"
},
"id": "7619267199133",
"volume": {
"quantity": "5",
"unit": "t"
}
}
],
"status": "COMPLETED",
"totalPrice": {
"amount": "30",
"currency": "EUR"
},
"totalVolume": {
"quantity": "5",
"unit": "t"
},
"updatedAt": "2023-01-19T13:31:13Z"
}
]
}
Updated almost 2 years ago