{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"API Examples","siteUrl":"https://docs.bettermile.com","jsonLd":{"@context":"https://schema.org","@type":"Organization","name":"Bettermile","url":"https://bettermile.com","logo":"https://docs.bettermile.com/images/logo.png"},"description":"Example Predict API request and response payloads, prediction granularity, and authentication requirements."},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"api-examples","__idx":0},"children":["API Examples"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"request--response-payloads","__idx":1},"children":["Request & Response Payloads"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You need to request the Predict information for each job."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-request-payload","__idx":2},"children":["Example request payload:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    parcelNumber (*): \"00JI2G26\",\n    estimatedDeliveryDate: \"2025-03-31\",\n    address:{\n        street (*): \"Oranienstr. 183\",\n        countryCode (*): \"DE\",\n        houseNumber: \"50\",\n        postalCode: \"10999\",\n        locality: \"Berlin\",\n        province: null\n    }\n\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-response-payload-sync--async","__idx":3},"children":["Example response payload (sync & async):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"[{\n    lowerBound: \"10:15:00\", (LocalTime)\n    upperBound: \"13:15:00\", (LocalTime)\n    date: \"2025-03-31\" (LocalDate)\n}]\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"prediction-granularity","__idx":4},"children":["Prediction granularity"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Delivery windows are provided in 15-minute increments (aligned to :00, :15, :30, :45)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Example: 14:15:00 – 16:15:00 means the predicted delivery is most likely within this window, rounded to the nearest quarter-hour."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"api-authentication--security","__idx":5},"children":["API Authentication & Security"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All API requests require authentication via OAuth 2.0. You can request them from your Bettermile representative. Additional details are available in the developer portal."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use HTTPS with valid certificates for all connections, including tenant-provided webhook endpoints."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Never expose credentials in frontend code."]}]}]},"headings":[{"value":"API Examples","id":"api-examples","depth":1},{"value":"Request & Response Payloads","id":"request--response-payloads","depth":3},{"value":"Example request payload:","id":"example-request-payload","depth":4},{"value":"Example response payload (sync & async):","id":"example-response-payload-sync--async","depth":4},{"value":"Prediction granularity","id":"prediction-granularity","depth":4},{"value":"API Authentication & Security","id":"api-authentication--security","depth":3}],"frontmatter":{"title":"API Examples","rbac":{"anonymous":"read","authenticated":"read"},"seo":{"description":"Example Predict API request and response payloads, prediction granularity, and authentication requirements.","title":"API Examples"}},"lastModified":"2026-10-01T11:41:53.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/tracking/predict/api-examples","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}