# Aos Order Check > Cloudflare Worker API for querying AOS guest orders. ## Base URL https://aos-order-check-scheduler.bbb0t.com ## Endpoints - GET https://aos-order-check-scheduler.bbb0t.com/health - GET https://aos-order-check-scheduler.bbb0t.com/api/ip - GET https://aos-order-check-scheduler.bbb0t.com/api/order?url=https://www.apple.com/xc/us/vieworder/... - GET https://aos-order-check-scheduler.bbb0t.com/api/order?orderNumber=W1658420712&email=barteletscholer@gmx.com - POST https://aos-order-check-scheduler.bbb0t.com/api/order ## Deployment Notes - This deployment may be a direct worker or the scheduler entrypoint. - The scheduler randomly forwards each request to one of 40 placement-specific replica workers. - Scheduler responses include the `x-aos-replica` header so you can observe the selected replica. - The root direct worker keeps the original non-scheduler behavior. - Before forwarding to a replica, the scheduler strips original client IP and forwarding headers such as `CF-Connecting-IP`, `CF-IPCountry`, `Forwarded`, `True-Client-IP`, `X-Forwarded-For`, and `X-Real-IP`. - If another Worker needs to call the scheduler, prefer the Custom Domain instead of the `workers.dev` URL. Same-zone Worker-to-Worker `fetch()` to a `workers.dev` target can fail unless you use a service binding. ## Input Rules IP check requires no input: - GET https://aos-order-check-scheduler.bbb0t.com/api/ip Provide either: 1. url 2. orderNumber and email POST body example: ```json { "orderNumber": "W1658420712", "email": "barteletscholer@gmx.com" } ``` ## Response Shape IP check response: ```json { "args": { "show_env": "1" }, "headers": { "X-Forwarded-For": "212.50.254.250" }, "origin": "212.50.254.250", "url": "https://httpbin.org/get?show_env=1" } ``` - GET /api/ip proxies the raw response body from https://httpbin.org/get?show_env=1. - The shape is intentionally not normalized by this Worker and may change if the upstream changes. - When called through the scheduler, any X-Forwarded-For or similar forwarding headers shown by GET /api/ip are generated on the replica-to-httpbin hop, not copied from the original scheduler request. Successful response: ```json { "ok": true, "requester": { "ip": "203.0.113.10", "country": "US" }, "order": { "orderNumber": "W1404176537", "orderPlacedDate": "December 5, 2024", "firstName": "Taylor", "lastName": "Nguyen", "storeName": "Apple Bridgeport Village", "isAddedId": false, "paymentType": "APID", "paymentLabel": "APID", "isInternationalCC": true, "itemCount": 1, "hasCanceledItems": false, "canceledItemCount": 0, "statusCounts": { "DELIVERED": 1 }, "items": [ { "itemId": "orderItem-0000101", "index": 0, "productName": "iPhone 16 Pro 128GB Desert Titanium", "itemShortName": null, "quantity": 1, "status": "DELIVERED", "statusDescription": "DELIVERED", "currentStatus": "DELIVERED", "isCanceled": false, "canceledDate": null, "deliveryDate": "Delivered December 12, 2024", "deliveryType": "HOME", "storeName": null, "trackingNumbers": [], "trackingUrls": [], "shippingEditable": false } ] } } ``` ## Field Notes Top-level fields: - requester - orderNumber - orderPlacedDate - firstName - lastName - storeName - isAddedId - paymentType - paymentLabel - isInternationalCC - itemCount - hasCanceledItems - canceledItemCount - statusCounts - items Requester fields: - ip - country Per-item fields: - itemId - index - productName - itemShortName - quantity - status - statusDescription - currentStatus - isCanceled - canceledDate - deliveryDate - deliveryType - storeName - trackingNumbers - trackingUrls - shippingEditable ## Behavior Notes - status is the main normalized business status. - canceledDate is populated only when item status is CANCELED. - trackingNumbers and trackingUrls may be empty arrays. - Orders can contain multiple items with different statuses. - requester.ip comes from the incoming CF-Connecting-IP header when available. - requester.country comes from request.cf.country when available. - For successful requests routed through the scheduler, original client IP and forwarding headers are removed before the replica handles the request, so requester.ip and requester.country may be null. - if this Worker is called by another Worker, requester fields describe the immediate caller context Cloudflare exposes, not necessarily an end-user browser. ## Errors - 400 for invalid client input (missing url/orderNumber+email or invalid JSON body). - Upstream Apple 4xx responses are returned as-is (for example 403, 404, 429). - Apple genericSorryPage responses (for example /shop/order/sorry) are mapped to 403. - Upstream Apple 5xx responses are mapped to 502. - 500 for unexpected internal errors in this Worker.