Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alex-quiterio/740678ddf8ceee7e8820ff68e2b1c8c6 to your computer and use it in GitHub Desktop.
Save alex-quiterio/740678ddf8ceee7e8820ff68e2b1c8c6 to your computer and use it in GitHub Desktop.
Waste Saver: Patch Waste Stream Configuration

WasteSaver Audit: Update StreamConfiguration endpoint

  • OLD ENDPOINT: PUT /api/store/locations/:org_location_id/streams/:uuid
  • NEW ENDPOINT: PATCH /api/store/locations/:org_location_id/waste-stream-configurations/:uuid

Request payload proposal:

{
  "quantity": 1,
  "pickup_point_id": "259196f2-287b-4a99-a731-e716398d1eae",
  "schedule": {
    "type": "SINGLE | WEEKLY | EVERY_TWO_WEEKS | EVERY_THREE_WEEKS | EVERY_FOUR_WEEKS | EVERY_SIX_WEEKS | EVERY_TWELVE_WEEKS",
    "days": [
      { "day": 3, "time_start": "08:00", "time_end": "18:00" },
      { "day": 5, "time_start": "08:00", "time_end": "18:00" }
    ]
  }
}

Response code: 201 Response payload proposal:

{
  "id": "8bf886ac-e975-46f5-8289-7aae693f018a",
  "status": "NEW | PENDING | APPROVED | IN_REVIEW",
  "is_cancellable": true,
  "hardware_products_available": true,
  "quantity": 3,
  "size": "20L",
  "schedule": {
    "type": "SINGLE | WEEKLY | EVERY_TWO_WEEKS | EVERY_THREE_WEEKS | EVERY_FOUR_WEEKS | EVERY_SIX_WEEKS | EVERY_TWELVE_WEEKS",
    "days": [
      {
        "day": 5,
        "time_end": "23:59",
        "time_start": "00:00"
      }
    ]
  },
  "waste_stream": {
   "name": { 
      "de-de": "Restmüll",
      "en-gb": "Residual Waste",
      "fr-fr": "Déchets résiduels",
      "nl-nl": "Restafval"
    },
    "image_url": "https://d39t4x71zbx2q8.cloudfront.net/streams/v2/RESTAFVAL.png",
    "background_color": "#625F63",
    "text_color": "#ffffff"
  },
  "pickup_point": {
    "id": "259196f2-287b-4a99-a731-e716398d1eae",
    "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
    }
  },
  "created_at": "2022-10-19 12:52:46.682394",
  "updated_at": "2022-10-19 12:52:46.682394"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment