WasteSaver Audit: Orders endpoint
OLD ENDPOINT: GET /api/store/locations/:org_location_id/orders
NEW ENDPOINT (remains the same): GET /api/store/locations/:org_location_id/orders
Payload proposal:
{
"items": [
{
"reference": "17241405128753672",
"date": "2022-08-24",
"size_display": "20L",
"quantity": 1,
"type": 1,
"scheduled_type": 2,
"status": "deleted | temporary | new | pending | scheduled | in_progress | completed | delayed | cancelled | issue | in_review",
"waste_stream": {
"name": {
"fr-fr": "PMD",
"de-de": "Verpackungen",
"nl-nl": "PMD",
"en-gb": "PMD"
}
},
"pickup_point": {
"name": "Pickup Point",
"address": {
"street_name": "Keizersgracht",
"house_number": "359",
"postal_code": "1016 EJ",
"town": "Amsterdam",
"country_code": "NL",
"lat": 52.3687078,
"lon": 4.8849146
}
},
"is_cancellable": true,
"is_issue_creatable": true,
"created_at": "2022-10-19 12:52:46.682394",
"updated_at": "2022-10-19 12:52:46.682394"
}
],
"pagination": {
"next": "/api/store/locations/0804795f-fbff-46f7-bd60-0ba0cd30d409/...",
"previous": null,
"first": "/api/store/locations/0804795f-fbff-46f7-bd60-0ba0cd30d409/...",
"last": "/api/store/locations/0804795f-fbff-46f7-bd60-0ba0cd30d409/...",
"total_pages": 2,
"total_items": 18
}
}
A couple of points that should be more clear in this proposal:
waste-stream-configurationsendpoint is usingwaste_streamto wrapnameand potentially other attributes. We might want to use the same name to describe this field).dateis not a boolean, but rather a string with the following formatYYYY-MM-DDcreated_atandupdated_atshould be included in the new payloadspickup_point_idis not enough to ensure that you have all the necessary information to render that particular record.Based on that, the suggested updated proposal is:
{ "items": [ { "reference": "17241405128753672", "date": "2022-08-24", "size_display": "20L", "quantity": 1, "type": "pickup | placement | rent | purchase | pickup_container | dropoff", "scheduled_type": "single | weekly | every_two_weeks | every_three_weeks | every_four_weeks | every_six_weeks | every_twelve_weeks", "status": "new | pending | scheduled | in_progress | completed | delayed | cancelled | issue | in_review", "waste_stream": { "name": { "fr-fr": "PMD", "de-de": "Verpackungen", "nl-nl": "PMD", "en-gb": "PMD" } }, "pickup_point": { "name": "Pickup Point", "address": { "street_name": "Keizersgracht", "house_number": "359", "postal_code": "1016 EJ", "town": "Amsterdam", "country_code": "NL", "lat": 52.3687078, "lon": 4.8849146 } }, "is_cancellable": true, "is_issue_creatable": true, "created_at": "2022-10-19 12:52:46.682394", "updated_at": "2022-10-19 12:52:46.682394" } ], "pagination": { "next": "/api/store/locations/0804795f-fbff-46f7-bd60-0ba0cd30d409/...", "previous": null, "first": "/api/store/locations/0804795f-fbff-46f7-bd60-0ba0cd30d409/...", "last": "/api/store/locations/0804795f-fbff-46f7-bd60-0ba0cd30d409/...", "total_pages": 2, "total_items": 18 } }