{"openapi":"3.0.3","info":{"title":"AgenWebsite Rate API","version":"1.0.0","contact":{"name":"AgenWebsite","url":"https://www.agenwebsite.com"},"description":"Live Indonesian shipping rates from 14 couriers (JNE, J&T Express, SiCepat, POS Indonesia, AnterAja, TIKI, Paxel, GoSend, RPX, Lion Parcel, SAP Express, SPX Express, J&T Cargo, Lalamove) through one endpoint.\n\n**Authentication:** send your key in the `x-api-key` header. Keys are created in your AgenWebsite account.\n\n**Quota:** every `/v1` call counts as one request against your plan's daily quota, which resets at 00:00 WIB. Each response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. Plans also have a per-minute burst limit. Over either limit the API answers `429` with `Retry-After`.\n\n**Errors:** every error uses the same envelope: `{ \"success\": false, \"error\": { \"code\", \"message\", \"field?\", \"request_id\" } }`.\n\nGuides: https://www.agenwebsite.com/documentation/agenwebsite-rate-api/"},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your Rate API key, e.g. `awk_live_...`."}},"schemas":{"Error":{"type":"object","description":"Every non-2xx response uses this envelope.","required":["success","error"],"properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","required":["code","message","request_id"],"properties":{"code":{"type":"string","description":"Stable, machine-readable error code. Branch on this, not on the message.","enum":["validation_error","unauthorized","unsupported_courier","rate_limit_exceeded","courier_upstream_error","internal_error"]},"message":{"type":"string","description":"Human-readable explanation."},"field":{"type":"string","description":"Request field the error refers to, when there is one (e.g. `weight`, `couriers`)."},"request_id":{"type":"string","description":"Unique request id. Quote it when contacting support."}}}}}},"responses":{"ValidationError":{"description":"The request is malformed or a parameter is out of range.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"validation_error":{"value":{"success":false,"error":{"code":"validation_error","message":"weight must be an integer (grams).","field":"weight","request_id":"req_mhx2k9a1b7c3d5e8"}}}}}}},"Unauthorized":{"description":"The `x-api-key` header is missing, unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"missing_or_invalid":{"value":{"success":false,"error":{"code":"unauthorized","message":"Invalid or missing API key.","request_id":"req_mhx2k9a1b7c3d5e8"}}}}}}},"UnsupportedCourier":{"description":"One of the requested couriers is not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unsupported_courier":{"value":{"success":false,"error":{"code":"unsupported_courier","message":"Courier 'fedex' is not supported. Available couriers: jnt, jne, sicepat, pos, anteraja, tiki, paxel, gosend, rpx, lion, sap, spx, jtc, lalamove.","field":"couriers","request_id":"req_mhx2k9a1b7c3d5e8"}}}}}}},"RateLimited":{"description":"Per-minute burst limit or daily quota exceeded. Retry after the number of seconds in `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"daily_quota":{"value":{"success":false,"error":{"code":"rate_limit_exceeded","message":"Your daily API quota has been exhausted.","request_id":"req_mhx2k9a1b7c3d5e8"}}},"burst":{"value":{"success":false,"error":{"code":"rate_limit_exceeded","message":"Per-minute request limit exceeded. Please try again shortly.","request_id":"req_mhx2k9a1b7c3d5e8"}}}}}},"headers":{"Retry-After":{"description":"Seconds until you may retry.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Daily request quota of your plan (-1 = unlimited).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left today (-1 = unlimited).","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time (seconds) of the next quota reset, 00:00 WIB (UTC+7).","schema":{"type":"integer"}}}},"UpstreamError":{"description":"No courier returned a rate for this route right now. Safe to retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"courier_upstream_error":{"value":{"success":false,"error":{"code":"courier_upstream_error","message":"Failed to fetch rates from couriers.","request_id":"req_mhx2k9a1b7c3d5e8"}}}}}}},"InternalError":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"internal_error":{"value":{"success":false,"error":{"code":"internal_error","message":"Terjadi kesalahan internal.","request_id":"req_mhx2k9a1b7c3d5e8"}}}}}}}}},"paths":{"/v1/rates":{"post":{"summary":"Calculate shipping rates","tags":["Rates"],"description":"Returns live, branded rates from every supported courier (or the subset in `couriers`) for one shipment.\n\nIdentify the shipper and the destination by a `zipcode`, or by `province` + `city` + `district` (`subdistrict` optional). `GET /v1/locations/search` returns both forms. `weight` is in grams; `dimensions` (cm) are optional and only affect couriers that bill volumetric weight.\n\n**Instant couriers** (Lalamove, GoSend, Paxel instant) price by distance: add `latlng` (`\"latitude,longitude\"`, decimal degrees) to BOTH shipper and destination, next to the zipcode or region. Without it they are left out of the result (a request for only `lalamove`/`gosend` without it gets a 400). They serve same-city routes only; their lines have `service_type: \"instant\"`, `etd_max_days: 0` and an hour range in `etd_text`.\n\nEvery call counts as one request against your daily quota.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"shipper":{"type":"object","properties":{"zipcode":{"type":"string","pattern":"^\\d{4,6}$"},"province":{"type":"string","minLength":1,"maxLength":120},"city":{"type":"string","minLength":1,"maxLength":120},"district":{"type":"string","minLength":1,"maxLength":120},"subdistrict":{"type":"string","minLength":1,"maxLength":120},"latlng":{"type":"string","pattern":"^-?\\d{1,2}(\\.\\d+)?,\\s*-?\\d{1,3}(\\.\\d+)?$","description":"Coordinates \"latitude,longitude\" (decimal degrees). Needed on BOTH parties for instant couriers (lalamove, gosend, paxel instant); other couriers ignore it."}},"additionalProperties":false},"destination":{"type":"object","properties":{"zipcode":{"type":"string","pattern":"^\\d{4,6}$"},"province":{"type":"string","minLength":1,"maxLength":120},"city":{"type":"string","minLength":1,"maxLength":120},"district":{"type":"string","minLength":1,"maxLength":120},"subdistrict":{"type":"string","minLength":1,"maxLength":120},"latlng":{"type":"string","pattern":"^-?\\d{1,2}(\\.\\d+)?,\\s*-?\\d{1,3}(\\.\\d+)?$","description":"Coordinates \"latitude,longitude\" (decimal degrees). Needed on BOTH parties for instant couriers (lalamove, gosend, paxel instant); other couriers ignore it."}},"additionalProperties":false},"weight":{"type":"integer","exclusiveMinimum":true,"minimum":0},"dimensions":{"type":"object","properties":{"length":{"type":"number","exclusiveMinimum":true,"minimum":0},"width":{"type":"number","exclusiveMinimum":true,"minimum":0},"height":{"type":"number","exclusiveMinimum":true,"minimum":0}},"required":["length","width","height"],"additionalProperties":false},"couriers":{"type":"array","items":{"type":"string","minLength":1},"maxItems":14},"sort":{"type":"string","enum":["cheapest","fastest"]}},"required":["shipper","destination","weight"],"additionalProperties":false},"examples":{"by_zipcode":{"summary":"By postal code, two couriers, cheapest first","value":{"shipper":{"zipcode":"40135"},"destination":{"zipcode":"12940"},"weight":1000,"couriers":["jne","sicepat"],"sort":"cheapest"}},"by_region":{"summary":"By region names, all couriers, with dimensions","value":{"shipper":{"province":"Jawa Barat","city":"Bandung","district":"Coblong","subdistrict":"Dago"},"destination":{"province":"DKI Jakarta","city":"Jakarta Selatan","district":"Setiabudi"},"weight":2500,"dimensions":{"length":30,"width":20,"height":15}}},"instant_with_coordinates":{"summary":"Same-city instant delivery (Lalamove, GoSend): latlng on both parties","value":{"shipper":{"zipcode":"12190","latlng":"-6.2245,106.8296"},"destination":{"zipcode":"10310","latlng":"-6.1951,106.8231"},"weight":3000,"couriers":["lalamove","gosend"],"sort":"cheapest"}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Rates for the route, with the cheapest and fastest service flagged.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"currency":{"type":"string","enum":["IDR"]},"data":{"type":"object","properties":{"rates":{"type":"array","items":{"type":"object","properties":{"courier_code":{"type":"string"},"courier_name":{"type":"string"},"courier_logo_url":{"type":"string"},"service_code":{"type":"string"},"service_name":{"type":"string"},"service_type":{"type":"string"},"cost":{"type":"number"},"cost_formatted":{"type":"string"},"etd_min_days":{"type":"number"},"etd_max_days":{"type":"number"},"etd_text":{"type":"string"},"estimated_delivery":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"additionalProperties":false},"cheapest":{"type":"boolean"},"fastest":{"type":"boolean"},"source":{"type":"string"}},"required":["courier_code","courier_name","courier_logo_url","service_code","service_name","service_type","cost","cost_formatted","etd_min_days","etd_max_days","etd_text","estimated_delivery","cheapest","fastest","source"],"additionalProperties":false}},"cheapest":{"type":"object","properties":{"service_code":{"type":"string"},"cost":{"type":"number"}},"required":["service_code","cost"],"additionalProperties":false,"nullable":true},"fastest":{"type":"object","properties":{"service_code":{"type":"string"},"etd_max_days":{"type":"number"}},"required":["service_code","etd_max_days"],"additionalProperties":false,"nullable":true},"summary":{"type":"object","properties":{"count":{"type":"number"},"cost_range":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"],"additionalProperties":false}},"required":["count","cost_range"],"additionalProperties":false}},"required":["rates","cheapest","fastest","summary"],"additionalProperties":false},"rate_limit":{"type":"object","properties":{"limit":{"type":"number"},"remaining":{"type":"number"},"reset_at":{"type":"string"}},"required":["limit","remaining","reset_at"],"additionalProperties":false}},"required":["success","currency","data","rate_limit"],"additionalProperties":false},"example":{"success":true,"currency":"IDR","data":{"rates":[{"courier_code":"jne","courier_name":"JNE","courier_logo_url":"https://assets-agenwebsite.b-cdn.net/images/couriers/jne.png","service_code":"REG","service_name":"JNE Reguler","service_type":"regular","cost":11000,"cost_formatted":"Rp 11.000","etd_min_days":2,"etd_max_days":3,"etd_text":"2-3 days","estimated_delivery":{"from":"2026-11-19","to":"2026-11-20"},"cheapest":true,"fastest":false,"source":"live"},{"courier_code":"sicepat","courier_name":"SiCepat","courier_logo_url":"https://assets-agenwebsite.b-cdn.net/images/couriers/sicepat.png","service_code":"BEST","service_name":"SiCepat BEST","service_type":"express","cost":23000,"cost_formatted":"Rp 23.000","etd_min_days":1,"etd_max_days":1,"etd_text":"1 day","estimated_delivery":{"from":"2026-11-18","to":"2026-11-18"},"cheapest":false,"fastest":true,"source":"live"}],"cheapest":{"service_code":"REG","cost":11000},"fastest":{"service_code":"BEST","etd_max_days":1},"summary":{"count":2,"cost_range":{"min":11000,"max":23000}}},"rate_limit":{"limit":30000,"remaining":29874,"reset_at":"2026-11-18T00:00:00+07:00"}}}},"headers":{"X-RateLimit-Limit":{"description":"Daily request quota of your plan (-1 = unlimited).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left today (-1 = unlimited).","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time (seconds) of the next quota reset, 00:00 WIB (UTC+7).","schema":{"type":"integer"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/UnsupportedCourier"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"502":{"$ref":"#/components/responses/UpstreamError"}},"operationId":"calculateRates"}},"/v1/couriers":{"get":{"summary":"List supported couriers","tags":["Couriers"],"description":"The courier catalog. Use `courier_code` values in the `couriers` field of `POST /v1/rates`. `cod_supported` and `insurance_supported` say whether a shipment with that courier can be booked as COD, or with shipping insurance, through AgenWebsite. Instant couriers (gosend, lalamove) support neither. Counts as one request against your daily quota.","security":[{"apiKey":[]}],"responses":{"200":{"description":"All supported couriers.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"courier_code":{"type":"string"},"courier_name":{"type":"string"},"logo_url":{"type":"string"},"cod_supported":{"type":"boolean","description":"A shipment with this courier can be booked as cash on delivery (COD) through AgenWebsite."},"insurance_supported":{"type":"boolean","description":"Shipping insurance can be added for this courier."}},"required":["courier_code","courier_name","logo_url","cod_supported","insurance_supported"],"additionalProperties":false}},"meta":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"],"additionalProperties":false}},"required":["success","data","meta"],"additionalProperties":false},"example":{"success":true,"data":[{"courier_code":"jne","courier_name":"JNE","logo_url":"https://assets-agenwebsite.b-cdn.net/images/couriers/jne.png","cod_supported":true,"insurance_supported":true},{"courier_code":"sicepat","courier_name":"SiCepat","logo_url":"https://assets-agenwebsite.b-cdn.net/images/couriers/sicepat.png","cod_supported":true,"insurance_supported":true},{"courier_code":"pos","courier_name":"POS Indonesia","logo_url":"https://assets-agenwebsite.b-cdn.net/images/couriers/pos.png","cod_supported":false,"insurance_supported":true},{"courier_code":"lalamove","courier_name":"Lalamove","logo_url":"https://assets-agenwebsite.b-cdn.net/images/couriers/lalamove.png","cod_supported":false,"insurance_supported":false}],"meta":{"count":4}}}},"headers":{"X-RateLimit-Limit":{"description":"Daily request quota of your plan (-1 = unlimited).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left today (-1 = unlimited).","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time (seconds) of the next quota reset, 00:00 WIB (UTC+7).","schema":{"type":"integer"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"listCouriers"}},"/v1/locations/search":{"get":{"summary":"Search locations (subdistrict / city / postal code)","tags":["Locations"],"description":"Autocomplete over Indonesian regions (province, city, district, subdistrict) and postal codes. A numeric `q` also matches postal codes by prefix. Feed `postal_code`, or `province` + `city` + `district`, into `POST /v1/rates`. Counts as one request against your daily quota.","parameters":[{"schema":{"type":"string","minLength":2,"maxLength":100},"in":"query","name":"q","required":true,"description":"Search text, at least 2 characters: a region name or the start of a postal code."},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":10},"in":"query","name":"limit","required":false,"description":"Maximum number of results (1-50, default 10)."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Matching locations (an empty `data` array when nothing matches).","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"subdistrict_id":{"type":"integer","nullable":true},"postal_code":{"type":"string"},"subdistrict":{"type":"string"},"district":{"type":"string"},"city":{"type":"string"},"province":{"type":"string"},"label":{"type":"string"}},"required":["subdistrict_id","postal_code","subdistrict","district","city","province","label"],"additionalProperties":false}},"meta":{"type":"object","properties":{"count":{"type":"number"},"query":{"type":"string"}},"required":["count","query"],"additionalProperties":false}},"required":["success","data","meta"],"additionalProperties":false},"example":{"success":true,"data":[{"subdistrict_id":3204100,"postal_code":"40135","subdistrict":"Dago","district":"Coblong","city":"Bandung","province":"Jawa Barat","label":"Dago, Coblong, Bandung, Jawa Barat, 40135"}],"meta":{"count":1,"query":"dago"}}}},"headers":{"X-RateLimit-Limit":{"description":"Daily request quota of your plan (-1 = unlimited).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left today (-1 = unlimited).","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time (seconds) of the next quota reset, 00:00 WIB (UTC+7).","schema":{"type":"integer"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"searchLocations"}},"/v1/usage":{"get":{"summary":"API quota and usage for today","tags":["Usage"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Today's quota state for the key's account.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"plan":{"type":"string","enum":["free","pro","max"]},"limit":{"type":"number","description":"Daily quota (-1 = unlimited)"},"used":{"type":"number","description":"Requests used today (WIB)"},"remaining":{"type":"number","description":"Remaining requests today (-1 = unlimited)"},"reset_at":{"type":"string","description":"Next quota reset time (00:00 WIB)"}},"required":["plan","limit","used","remaining","reset_at"],"additionalProperties":false}},"required":["success","data"],"additionalProperties":false},"example":{"success":true,"data":{"plan":"pro","limit":30000,"used":126,"remaining":29874,"reset_at":"2026-11-18T00:00:00+07:00"}}}},"headers":{"X-RateLimit-Limit":{"description":"Daily request quota of your plan (-1 = unlimited).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left today (-1 = unlimited).","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time (seconds) of the next quota reset, 00:00 WIB (UTC+7).","schema":{"type":"integer"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"description":"Your plan, daily limit and how much of it you used today. The quota resets at 00:00 WIB (UTC+7). This call itself counts as one request.","operationId":"getUsage"}}},"servers":[{"url":"https://api.agenwebsite.com","description":"Production"}],"externalDocs":{"description":"Rate API guides","url":"https://www.agenwebsite.com/documentation/agenwebsite-rate-api/"},"security":[{"apiKey":[]}],"tags":[{"name":"Rates","description":"Shipping rate calculation."},{"name":"Couriers","description":"Supported courier catalog."},{"name":"Locations","description":"Region and postal code lookup."},{"name":"Usage","description":"Quota and usage of your API key."}]}