### Get Started with Mengantar.com Public API Source: https://api-public.mengantar.com/docs/index This section provides the base URL and explains the requirement for an API key to access Mengantar.com's public API endpoints. It serves as the initial setup guide for API integration. ```APIDOC API Endpoint: {BASE_URL}/api/public/{API_KEY} ``` -------------------------------- ### Example JSON Response for Get Invoices API Source: https://api-public.mengantar.com/docs/index This is an example of the JSON response returned by the Get Invoices API endpoint. It illustrates the structure of the invoice data, including sub-items, status, user details, financial amounts, and timestamps. ```APIDOC { "success": true, "data": [ { "subItems": [], "status": "statusCleared", "courier": "system", "needToNotify": false, "adminCreated": false, "_id": "632c19f216b1eb234a8e7ebb", "user_id": "5fc6289532d4f232eb029ac8", "user": { "name": "Name", "email": "[email\u00a0protected]" }, "inv_number": "SS2209220816416", "expiration_date": "2022-09-24T08:16:00.000Z", "type": "typeWithdraw", "amount": 12345, "total": 12345, "createdAt": "2022-09-22T08:16:50.143Z", "updatedAt": "2022-09-22T08:21:07.344Z", "balanceAmount": 9635676, "userBalanceData": { "netValue": 30000000, "realNetValue": 0 }, "balance": 9635676, "api_req_id": "632c1aef994aea3981f68ae6", "api_req_message": "Success", "api_req_status": "DONE", "api_type": "oy", "paydAt": "2022-09-22T08:21:07.344Z" } ], "count": 19, "balance": 9635676 } ``` -------------------------------- ### Example Response for Get Receiver Score Source: https://api-public.mengantar.com/docs/index Illustrates the structure and content of a successful JSON response when retrieving receiver score data, including courier-specific statistics like total packages, value, in-progress, delivered, RTS, undelivered, and rate. ```json { "success": true, "data": { "_id": "64719ada8f853438986abb2a", "phone": "8123456789", "JNE": { "total": 36, "value": 10542000, "inProgress": 3652, "delivered": 35, "rts": 1, "undelivered": 0, "rate": 9.7 }, "SiCepat": { "total": 3, "value": 350000, "inProgress": 654, "delivered": 2, "rts": 1, "undelivered": 0, "rate": 6.7 }, "Sap": { "total": 3, "value": 710000, "inProgress": 528, "delivered": 2, "rts": 0, "undelivered": 1, "rate": 6.7 }, "iDexpress": { "total": 1, "value": 75000, "inProgress": 1151, "delivered": 1, "rts": 0, "undelivered": 0, "rate": 10 }, "JT": { "total": 4, "value": 450000, "inProgress": 2970, "delivered": 2, "rts": 1, "undelivered": 1, "rate": 5 }, "Ninja": { "total": 4, "value": 880000, "inProgress": 285, "delivered": 4, "rts": 0, "undelivered": 0, "rate": 10 }, "createdAt": "2023-05-27T05:53:30.132Z", "updatedAt": "2025-06-04T07:05:33.146Z" } } ``` -------------------------------- ### Example Successful Order Creation API Response Source: https://api-public.mengantar.com/docs/index This JSON object illustrates a successful response from the order creation API endpoint. It includes details such as order status, COD amount, pickup and receiver information, tracking details, pricing, and timestamps. ```json { "success": true, "data": [ { "assignee": null, "receiverScore": { "delivered": 0, "rts": 0, "undelivered": 0, "rate": 0 }, "isBreach": false, "COD_AMOUNT": 1000, "status": "active", "statusCategory": "active", "isDraft": false, "isDeleted": false, "isArchived": false, "isPaid": true, "isPreviouslyUnPaid": false, "isPreviouslyError": false, "history": [], "plan": "Standart JNE", "isHideForPrint": false, "isHideCityAndPhoneForPrint": false, "ticketStatus": "none", "dontIncludeSubdistrict": true, "isChatResponseSent": false, "screenshots": [], "printedDates": [], "isPlant": false, "fakeStatus": false, "issueType": "none", "trackingAdmins": [], "CourierAdminReply": false, "followedBy": [], "urgent": false, "possibleClaim": "", "_id": "6332f5ba8c3ea4bc8e15f72e", "destinationMark": "destinationMark", "PICKUP_NAME": "address", "PICKUP_PIC": "address", "PICKUP_PIC_PHONE": "12312345", "PICKUP_ADDRESS": "123123", "PICKUP_DISTRICT": "GROGOL PETAMBURAN", "PICKUP_CITY": "JAKARTA BARAT", "PICKUP_SERVICE": "REG", "PICKUP_VEHICLE": "MOTOR", "ORDER_ID": "22092742ED56", "SHIPPER_NAME": "address", "SHIPPER_ADDR1": "123123", "SHIPPER_CITY": "JAKARTA BARAT", "SHIPPER_ZIP": "11460", "SHIPPER_REGION": "DKI JAKARTA", "SHIPPER_COUNTRY": "INDONESIA", "SHIPPER_CONTACT": "address", "SHIPPER_PHONE": "12312345", "RECEIVER_NAME": "name", "RECEIVER_ADDR1": "address", "RECEIVER_CITY": "DOMPU", "RECEIVER_ZIP": "84217", "RECEIVER_REGION": "NUSA TENGGARA BARAT (NTB)", "RECEIVER_COUNTRY": "INDONESIA", "RECEIVER_CONTACT": "name", "RECEIVER_PHONE": "123456", "ORIGIN_CODE": "JK0702", "DESTINATION_CODE": "LO02", "SERVICE_CODE": "REG", "WEIGHT": 1, "QTY": 2, "GOODS_DESC": "asdasd", "GOODS_AMOUNT": 1000, "INSURANCE_FLAG": "Y", "SPECIAL_INS": "deliveryInstruction", "MERCHANT_ID": "5fc6289532d4f232eb029ac8", "TYPE": "PICKUP", "COD_FLAG": "2", "COD_FEE": 33, "PICKUP_REGION": "DKI JAKARTA", "insuranceamount": 0, "address_id": "62e27d67ecf5ae2893bc070a", "RECEIVER_SUBDISTRICT": "KARIJAWA", "RECEIVER_DISTRICT": "DOMPU", "cnote_no": "DMP00097790689", "sapData": { "origin_branch_code": "JKB", "destination_branch_code": "BMU", "tlc_branch_code": "BMU", "label": "http://apisanbox.coresyssap.com/shipment/label/printout?awb_no=DMP00097790689&api_key=DEV_m4rK3tPlac3%23_2019" }, "time_id": "62e27d81ecf5ae2893bc070b", "user_id": "5fc6289532d4f232eb029ac8", "user": { "email": "[email\u00a0protected]", "name": "Name" }, "batch_id": "6332f5b98c3ea4bc8e15f72d", "batch": "22092720165C00", "estimatedPrice": 43033, "estimatedSpecialPrice": 34433, "discount": 8600, "price": 43000, "zone": "A", "lastStatusChange": "2022-09-27T20:08:00.000Z", "receiver_id": "6332f0b166de6c6340029582", "createdDate": "2022-09-27T13:08:08.687Z", "proofHistory": [], "chats": [], "createdAt": "2022-09-27T13:08:10.263Z", "updatedAt": "2022-09-27T13:08:10.263Z" } ] } ``` -------------------------------- ### Retrieve Batches via API Source: https://api-public.mengantar.com/docs/index Illustrates how to fetch a list of batches using a GET request to the API. This endpoint allows filtering by page number, size, date range, and courier. ```curl curl \ -X GET {BASE_URL}/api/public/{API_KEY}/batch \ -d 'page=1' \ -d 'size=50' \ -d 'dateRange={"startDate":"2021-09-23T00:00:00.000Z","endDate":"2022-09-23T23:59:59.999Z"}' \ -d 'courier=Sap' ``` ```APIDOC GET {BASE_URL}/api/public/{API_KEY}/batch Result example : { "success": true, "data": [ { "isDraft": false, "isDeleted": false, "isArchived": false, "orders": 0, "error": 0, "unpaid": 0, "delivered": 0, "undelivered": 0, "rts": 0, "reconciled": 0, "active": 0, "totalToPay": 0, "totalToPaySpecial": 0, "printErrorBills": false, "plan": "Standart JNE", "isActive": true, "printedDates": [], "_id": "63330dd0d87f79e901f35824", "user_id": "5fc6289532d4f232eb029ac8", "user": { "email": "[email\u00a0protected]", "name": "Name" }, "address": { "PICKUP_NAME": "address", "PICKUP_PIC": "address", "PICKUP_PIC_PHONE": "12312345", "PICKUP_ADDRESS": "123123", "PICKUP_DISTRICT": "GROGOL PETAMBURAN", "PICKUP_CITY": "JAKARTA BARAT" }, "address_id": "62e27d67ecf5ae2893bc070a", "id": "22092721DBC7B5", "newBatchId": 1, "invalidOrders": null, "draftData": null, "createdAt": "2022-09-27T14:50:56.477Z", "updatedAt": "2022-09-27T14:50:56.477Z", "__v": 0 } ] } ``` -------------------------------- ### Retrieve Available Pickup Times Source: https://api-public.mengantar.com/docs/index This snippet demonstrates how to fetch available pickup times for a specific address using a GET request. It requires the address ID as a data parameter. ```curl curl \ -X GET {BASE_URL}/api/public/{API_KEY}/time' \ -d 'address=62e27d67ecf5ae2893bc070a' ``` ```APIDOC GET {BASE_URL}/api/public/{API_KEY}/time Result example : { "success": true, "data": [ { "_id": "62e27d81ecf5ae2893bc070b", "date": "2023-02-24T12:00:00.000Z", "time": "12:00" }, { "_id": "62ea1fcaf0e12d8a980d8eb9", "date": "2023-12-22T10:00:00.000Z", "time": "10:00" } ] } ``` -------------------------------- ### Retrieve Invoices API Call Source: https://api-public.mengantar.com/docs/index This snippet demonstrates how to make a GET request to retrieve a list of invoices. It shows both a cURL command and the direct API endpoint path. The request requires a base URL and an API key. ```curl curl \ -X GET {BASE_URL}/api/public/{API_KEY}/invoices' \' ``` ```APIDOC GET `{BASE_URL}/api/public/{API_KEY}/invoices` ``` -------------------------------- ### Query Parameters for Get Receiver Score API Source: https://api-public.mengantar.com/docs/index Details the required query parameters for the Get Receiver Score API endpoint, including their types and descriptions. ```APIDOC Parameter: search Type: String Description: receiver phone number ``` -------------------------------- ### Search Address Data by Keyword (GET /address/search) Source: https://api-public.mengantar.com/docs/index This API endpoint allows users to search for origin and destination codes by providing a keyword. It's crucial for obtaining the necessary IDs for subsequent address-related operations. The response includes detailed address information like province, city, district, and various codes. ```curl curl \ -X GET {BASE_URL}/api/public/{API_KEY}/address/search?keyword=papua ``` ```APIDOC GET `{BASE_URL}/api/public/{API_KEY}/address/search` QUERY PARAMETERS: | Field | Type | Description | |---------|--------|-------------------------------------------| | keyword | String | Province / City / District / Subdistrict / Zip | ``` ```json { "success": true, "data": [ { "COUNTRY_NAME": "Indonesia", "closedSi": true, "unsupportedSi": true, "change": 1, "_id": "5fc63038f8f44b34aa4c1cc4", "PROVINCE_NAME": "PAPUA", "CITY_NAME": "MERAUKE", "DISTRICT_NAME": "MUTING", "SUBDISTRICT_NAME": "SEED AGUNG (SEDAYU AGUNG PRASASTI)", "ZIP_CODE": "99652", "DESTINATION_CODE": "DJJ20411", "createdAt": "2020-12-01T11:59:52.763Z", "updatedAt": "2022-06-08T15:36:19.860Z", "__v": 0, "ORIGIN_CODE": "DJJ20400", "CITY_NAME_SI": "Kab. Merauke", "DESTINATION_CODE_SI": "DJJ20411", "ORIGIN_CODE_SI": "MKQ", "CODE_SAP": "PA1510" } ] } ``` -------------------------------- ### Retrieve Assigned Users List Source: https://api-public.mengantar.com/docs/index This snippet demonstrates how to fetch a list of assigned users (assignees) using a GET request to the public API. It requires a base URL and an API key for authentication. ```curl curl \ -X GET {BASE_URL}/api/public/{API_KEY}/my-users' ``` ```APIDOC GET {BASE_URL}/api/public/{API_KEY}/my-users Result example : { "success": true, "data": [ { "_id": "67d116f5b68d715ee586ab96", "name": "abbi", "email": "[email\u00a0protected]" }, { "_id": "67c58e190a9a21d23e220207", "name": "Udin Conello", "email": "[email\u00a0protected]" }, ... ] } ``` -------------------------------- ### Retrieve User Address via API Source: https://api-public.mengantar.com/docs/index This snippet demonstrates how to fetch a user's registered address details using a GET request to the public API. It requires a base URL and an API key for authentication. ```curl curl \ -X GET {BASE_URL}/api/public/{API_KEY}/address' ``` ```APIDOC GET {BASE_URL}/api/public/{API_KEY}/address Result Example : { "success": true, "data": [ { "isHide": false, "dontIncludeSubdistrict": false, "isPlant": false, "_id": "632d6c76361422945dbaafd8", "PICKUP_AUTOFILL": "5fc63038f8f44b34aa4c1cc4", "PICKUP_ADDRESS": "Jl. Sederhana No. 142", "PICKUP_PIC_PHONE": "085270391495", "PICKUP_PIC": "PIC Name", "PICKUP_NAME": "Seller or Store Name", "user_id": "5fc6289532d4f232eb029ac8", "PICKUP_DISTRICT": "MUTING", "PICKUP_SUBDISTRICT": "SEED AGUNG (SEDAYU AGUNG PRASASTI)", "PICKUP_REGION": "PAPUA", "PICKUP_CITY": "MERAUKE", "PICKUP_CITY_SI": "Kab. Merauke", "PICKUP_ZIP": "99652", "PICKUP_DESTINATION_CODE": "DJJ20411", "PICKUP_DESTINATION_CODE_SI": "DJJ20411", "PICKUP_ORIGIN_CODE": "DJJ20400", "PICKUP_ORIGIN_CODE_SI": "MKQ", "PICKUP_SAP_CODE": "PA1510", "PICKUP_FULL_AUTOFILL": "PAPUA, MERAUKE, MUTING, SEED AGUNG (SEDAYU AGUNG PRASASTI)", "createdAt": "2022-09-23T08:21:10.243Z", "updatedAt": "2022-09-23T08:21:10.243Z", "__v": 0 } ] } ``` -------------------------------- ### API Endpoint Definition: Get Receiver Score by Number Source: https://api-public.mengantar.com/docs/index Defines the GET endpoint for retrieving receiver score information based on a user's phone number. ```APIDOC Method: GET Path: {BASE_URL}/api/public/{API_KEY}/getReceiverScoreByNumberUser Description: Return Receiver Score per courier ``` -------------------------------- ### Get Receiver Score by Phone Number with cURL Source: https://api-public.mengantar.com/docs/index Demonstrates how to make a GET request to retrieve receiver score data using cURL, specifying the receiver's phone number as a query parameter. ```curl curl \ -X GET {BASE_URL}/api/public/{API_KEY}/getReceiverScoreByNumberUser?search=8123456789 ``` -------------------------------- ### Create Order via Mengantar.com Public API using cURL Source: https://api-public.mengantar.com/docs/index This cURL command demonstrates how to send a POST request to the Mengantar.com public API to create a new order. It includes form data for courier, pickup details (scheduled pickup, volume, address, time), and a list of orders with assignee, COD, customer details, parcel content, and delivery instructions. ```curl curl \ -X POST {BASE_URL}/api/public/{API_KEY}/order' \ -F 'courier=Sap' \ -F 'pickup={ type: "scheduledPickup", volume: "volumeMotor", address_id: "62e27d67ecf5ae2893bc070a", time_id: "62e27d81ecf5ae2893bc070b" }' \ -F 'orders=[{ "assignee": "5fc62dd8f8f44b34aa4bc9aa", "COD": "12444", "customerAddress": "address", "customerName": "name", "customerAddressDataId": "5fc62dd8f8f44b34aa4bc9aa", "customerPhone": "123456", "parcelContent": "asdasd", "destinationMark": "Destination Mark", "deliveryInstruction": "Delivery Instruction", "dontIncludeSubdistrict": true, "weight": 1, "quantity": 1 }]' ``` -------------------------------- ### Create Order API - Request Body Parameters Source: https://api-public.mengantar.com/docs/index Details the comprehensive set of parameters required to create a new order, including courier selection, assignee, detailed pickup information, and an array of order items with their respective values, weights, and content. This section defines the structure for the request payload. ```JSON "branch": "LO0", "branchOrigin": "JK0", "__v": 0 } ], "batch": "22092720165C00", "batch_id": "6332f5b98c3ea4bc8e15f72d", "errors": [] } ``` ```APIDOC Request Body Parameters: courier: String - The value should be "JNE" or "SiCepat" or "Sap" or "iDexpress" or "JT" or "Ninja" or "lion". assignee: String (Optional) - The value should be user_id (_id) from [Get Assignee API](#content-get-assignee). pickup: Object - Pickup data pickup.address_id: String - User's address _id pickup.type: String - scheduledPickup, dropOff pickup.time_id: String - time _id (required for type 'scheduledPickup') pickup.volume: String - volumeTruck, volumeMobil, volumeMotor (required for type 'scheduledPickup') orders: Array - Array of orders objects orders.goodsValue: Number - NON-COD value orders.COD: Number - COD value (required if goodsValue is empty). orders.customerAddressDataId: String - _if from /api/address/search orders.customerAddress: String - Customer Address orders.customerName: String - Customer Name orders.weight: Number - Weight. Unit in kg(kilogram) orders.quantity: Number - Quantity orders.parcelContent: String - Parcel Content / Product Name orders.destinationMark: String (Optional) orders.deliveryInstruction: String (Optional) orders.dontIncludeSubdistrict: Boolean (Optional) orders.cargo: Boolean (Optional) - if true then it will proceed with Cargo type. Couriers that have cargo option: (JNE, SiCepat, Sap, iDexpress) ``` -------------------------------- ### Mengantar.com Public API Order Endpoint Definition Source: https://api-public.mengantar.com/docs/index This section defines the POST endpoint for creating orders. It specifies the URL structure and notes that if the balance is insufficient, unpaid orders will be created with an empty cnote_no and 'unpaid' status set to true. ```APIDOC POST `{BASE_URL}/api/public/{API_KEY}/order` If balance is not enough will create unpaid orders with empty cnote_no and unpaid = true ``` -------------------------------- ### API: Query Parameters for Batch Retrieval Source: https://api-public.mengantar.com/docs/index Defines the available query parameters for filtering and retrieving batch information through the API, including page number, size, and courier. ```APIDOC page: String - Page Number size: String - Orders count on page courier: String - The value should be "JNE" or "SiCepat" or "Sap" or "iDexpress" or "JT" or "Ninja" or "lion". ``` -------------------------------- ### Estimate Order Price with Specific Courier Source: https://api-public.mengantar.com/docs/index This API endpoint allows users to estimate the shipping price for a specific order by providing origin, destination, courier, weight, and COD amount. It returns the estimated price, COD coverage, and discount details. The API also indicates if the service or COD is unsupported for the given route. ```curl curl \n-X GET {BASE_URL}/api/public/{API_KEY}/order/estimate' \n-d 'origin_id=5fc62f5df8f44b34aa4c0d8c' \n-d 'destination_id=5fc64714f8f44b34aa4cdd60' \n-d 'courier=Sap' \n-d 'weight=1' \n-d 'COD_AMOUNT=123' ``` ```APIDOC GET {BASE_URL}/api/public/{API_KEY}/order/estimate QUERY PARAMETERS: origin_id: String - _id of address data from this route /address/search destination_id: String - _id of address data from this route /address/search courier: String - The value should be "JNE" or "SiCepat" or "Sap" or "iDexpress" or "JT" or "Ninja" or "lion" or "all". The default value will be "JNE". For "all" value will return array of each courier weight: Number - (default: 1). Unit in kg(kilogram) COD_AMOUNT: Number - to calculate COD fee ``` ```json { "success": true, "data": { "price": 23000, "coverage_cod": false, "currency": "IDR", "discountPercent": 20, "discount": 4600, "codFee": 4, "estimatedPrice": 23004, "estimatedSpecialPrice": 18404, "unsupported_cod": false, // indicates if COD service is not supported for this area. "unsupported": false // indicates if courier service is not available for this area. } } ``` ```APIDOC Notes: - Possibilities for unsupported and unsupported_cod: - if unsupported true and unsupported_cod true, it means can't send to the destination - if unsupported true and unsupported_cod false, it means can't send to thedestination - if unsupported false & unsupported_cod true, it means can't send to destination with COD BUT still send to destination with Non COD - if unsupported false and unsupported_cod false, it means can send COD or Non COD - Discount calculation in this API is based on user's shipping volume, you can refer to this page [Diskon Ongkos Kirim](https://help.mengantar.com/id/articles/5207011-apa-kelebihan-mengantar). Unlike the Estimate Public API /allEstimatePublic which has a fixed 20% discount. ``` -------------------------------- ### Add User's Address (POST /address) Source: https://api-public.mengantar.com/docs/index This endpoint allows users to add a new address to their account. It requires pre-existing address data obtained from the `/address/search` endpoint. The API supports adding pickup details and optional shipper information, and can also be used to update an existing address by providing its `_id`. ```curl curl \ -X POST {BASE_URL}/api/public/{API_KEY}/address \ -F 'PICKUP_AUTOFILL=5fc63038f8f44b34aa4c1cc4' \ -F 'PICKUP_ADDRESS=Jl. Sederhana No. 142' \ -F 'PICKUP_PIC_PHONE=085270391495' \ -F 'PICKUP_PIC=PIC Name' \ -F 'PICKUP_NAME=Seller or Store Name' ``` ```APIDOC POST `{BASE_URL}/api/public/{API_KEY}/address` BODY PARAMETERS: | Field | Type | Description | |------------------|--------|------------------------------------------------| | PICKUP_AUTOFILL | String | _id of address data from this route `/address/search` | | PICKUP_ADDRESS | String | Address text | | PICKUP_PIC_PHONE | String | Phone Number | | PICKUP_PIC | String | PIC Name | | PICKUP_NAME | String | Seller or Store Name | | SHIPPER_ADDR1 | String | (optional) If return address is different | | SHIPPER_AUTOFILL | String | (optional) _id of address data from this route `/address/search` | | SHIPPER_CONTACT | String | (optional)Seller or Store Name | | SHIPPER_PHONE | String | (optional) Phone Number | | _id | String | (optional) Use address id to update existed address | ``` ```json { "success": true, "data": { "isHide": false, "dontIncludeSubdistrict": false, "isPlant": false, "_id": "632d6c76361422945dbaafd8", "PICKUP_AUTOFILL": "5fc63038f8f44b34aa4c1cc4", "PICKUP_ADDRESS": "Jl. Sederhana No. 142", "PICKUP_PIC_PHONE": "085270391495", "PICKUP_PIC": "PIC Name", "PICKUP_NAME": "Seller or Store Name", "user_id": "5fc6289532d4f232eb029ac8", "PICKUP_DISTRICT": "MUTING", "PICKUP_SUBDISTRICT": "SEED AGUNG (SEDAYU AGUNG PRASASTI)", "PICKUP_REGION": "PAPUA", "PICKUP_CITY": "MERAUKE", "PICKUP_CITY_SI": "Kab. Merauke", "PICKUP_ZIP": "99652", "PICKUP_DESTINATION_CODE": "DJJ20411", "PICKUP_DESTINATION_CODE_SI": "DJJ20411", "PICKUP_ORIGIN_CODE": "DJJ20400", "PICKUP_ORIGIN_CODE_SI": "MKQ", "PICKUP_SAP_CODE": "PA1510", "PICKUP_FULL_AUTOFILL": "PAPUA, MERAUKE, MUTING, SEED AGUNG (SEDAYU AGUNG PRASASTI)", "createdAt": "2022-09-23T08:21:10.243Z", "updatedAt": "2022-09-23T08:21:10.243Z", "__v": 0 } } ``` -------------------------------- ### Add Pickup Time for Order Creation Source: https://api-public.mengantar.com/docs/index This snippet demonstrates how to add a specific pickup time for an order using a POST request. It requires the address ID, desired date (mm-dd-yyyy), and time (e.g., 13:00) as form parameters. ```curl curl \ -X POST {BASE_URL}/api/public/{API_KEY}/time' \ -F 'address_id=62e27d67ecf5ae2893bc070a' \ -F 'date=11-27-2022' \ -F 'time=13:00' ``` ```APIDOC POST {BASE_URL}/api/public/{API_KEY}/time BODY PARAMETERS: | Field | Type | Description | |------------|--------|--------------------------------------------------------| | address_id | String | user's address _id | | date | String | mm-dd-yyyy format | | time | String | 9:00, 10:00, 11:00, 12:00, 13:00, 14:00, 15:00, 16:00, 17:00, 18:00 | Result example : { "success": true, "data": [ { "isHide": false, "dontIncludeSubdistrict": false, "isPlant": false, "_id": "632d6c76361422945dbaafd8", "PICKUP_AUTOFILL": "5fc63038f8f44b34aa4c1cc4", "PICKUP_ADDRESS": "Jl. Sederhana No. 142", "PICKUP_PIC_PHONE": "085270391495", "PICKUP_PIC": "PIC Name", "PICKUP_NAME": "Seller or Store Name", "user_id": "5fc6289532d4f232eb029ac8", "PICKUP_DISTRICT": "MUTING", "PICKUP_SUBDISTRICT": "SEED AGUNG (SEDAYU AGUNG PRASASTI)", "PICKUP_REGION": "PAPUA", "PICKUP_CITY": "MERAUKE", "PICKUP_CITY_SI": "Kab. Merauke", "PICKUP_ZIP": "99652", "PICKUP_DESTINATION_CODE": "DJJ20411", "PICKUP_DESTINATION_CODE_SI": "DJJ20411", "PICKUP_ORIGIN_CODE": "DJJ20400", "PICKUP_ORIGIN_CODE_SI": "MKQ", "PICKUP_SAP_CODE": "PA1510", "PICKUP_FULL_AUTOFILL": "PAPUA, MERAUKE, MUTING, SEED AGUNG (SEDAYU AGUNG PRASASTI)", "createdAt": "2022-09-23T08:21:10.243Z", "updatedAt": "2022-09-23T08:21:10.243Z", "__v": 0 } ] } ``` -------------------------------- ### Check Shipping Fees for All Couriers Source: https://api-public.mengantar.com/docs/index This API endpoint allows users to check shipping fees across all available couriers by providing origin, destination, weight, and COD amount. It returns a detailed breakdown of prices, discounts, and service availability for each courier. This API has a fixed 20% discount. ```curl curl \n-X GET {BASE_URL}/api/order/allEstimatePublic' \n-d 'origin_id=5fc62f5df8f44b34aa4c0d8c' \n-d 'destination_id=5fc64714f8f44b34aa4cdd60' \n-d 'weight=1' \n-d 'COD_AMOUNT=123' ``` ```APIDOC GET {BASE_URL}/api/order/allEstimatePublic QUERY PARAMETERS: origin_id: String - _id of address data from this route /address/search destination_id: String - _id of address data from this route /address/search weight: Number - (default: 1). Unit in kg(kilogram) COD_AMOUNT: Number - to calculate COD fee ``` ```json { "success": true, "data": { "JT": { "unsupported": false, "unsupported_cod": false, "price": 21000, "estimate_delivery": "-", "discountPercent": 20, "cargoDiscountPercent": 0, "discount": 4200, "cargoDiscount": 0, "codFee": 4, "estimatedPrice": 21004, "estimatedSpecialPrice": 16804, "cargoEstimatedPrice": 0, "cargoEstimatedSpecialPrice": 0, "estimatedDate": "2-4 hari", "discountExtraPercent": 0, "discountExtra": 0, "cargoDiscountExtraPercent": 0, "cargoDiscountExtra": 0 }, ...otherCouriers } } ``` ```APIDOC Notes: - Possibilities for unsupported and unsupported_cod: - if unsupported true and unsupported_cod true, it means can't send to the destination - if unsupported true and unsupported_cod false, it means can't send to thedestination - if unsupported false & unsupported_cod true, it means can't send to destination with COD BUT still send to destination with Non COD - if unsupported false and unsupported_cod false, it means can send COD or Non COD - Discount will always be 20% from shipping fee for all users. ``` -------------------------------- ### API: Query Parameters for Order Management Source: https://api-public.mengantar.com/docs/index Defines the available query parameters for filtering and retrieving order information through the API. These parameters allow for detailed searches based on page, size, courier, ticket status, receiver, date ranges, batch ID, tracking ID, order ID, COD status, order status, category, and update timestamps. ```APIDOC page: String - Page Number size: String - Orders count on page courier: String - The value should be "JNE" or "SiCepat" or "Sap" or "iDexpress" or "JT" or "Ninja" or "lion". ticketFilter: String - withticket, without, open, replied receiverFilter: String - 1,2,3,4,5,6,7,8,9,10 dateRange.startDate: Date - 2021-09-23T00:00:00.000Z dateRange.endDate: Date - 2021-09-23T00:00:00.000Z batch: String - batch _id tracking_id: String - Tracking ID (to get one order with status history) order_id: String - ORDER ID (to get one order with status history) cod: String - COD or NON_COD status: String - statuses separeted by comma category: String - collected_customer, yet_to_collect, need_attention, rts, pending_pickup, redelivery, undelivered, delivery_problem, over_sla, already_been_undelivered, been_undelivered_wo_ticket, been_undelivered_wo_proof no_update_after_hour: String - 48 no_update_after_day: String - 4,6,8,10,12,14,21 reseller: Boolean - show reseller order ``` -------------------------------- ### API: Body Parameters for Deleting Orders Source: https://api-public.mengantar.com/docs/index Defines the required body parameters for the Delete Orders API endpoint, including an array of order IDs or an optional array of orderIds. ```APIDOC ids: Array - Array of ids orderIds: Array - (optional) Array of ORDER_ID (if ids is exists, then do not send orderIds, or else, it will override the ids) ``` -------------------------------- ### API: Body Parameters for Deleting a Batch Source: https://api-public.mengantar.com/docs/index Defines the required body parameters for the Delete Batch API endpoint, specifically the batch ID. ```APIDOC id: Array - Batch id ``` -------------------------------- ### Retrieve Orders API Source: https://api-public.mengantar.com/docs/index Fetches a list of orders based on various filtering criteria such as pagination, date range, courier, COD status, update status, category, and specific statuses. Returns an array of order objects. ```curl curl \ -X GET {BASE_URL}/api/public/{API_KEY}/order \ -d 'page=1' \ -d 'size=50' \ -d 'dateRange={"startDate":"2021-09-23T00:00:00.000Z","endDate":"2022-09-23T23:59:59.999Z"}' \ -d 'courier=Sap' \ -d 'cod=NON_COD' \ -d 'no_update_after_day=4' \ -d 'no_update_after_hour=48' \ -d 'category=collected_customer' \ -d 'status={"DELIVERED": true}' ``` ```APIDOC GET {BASE_URL}/api/public/{API_KEY}/order ``` ```JSON { "success": true, "data": [ { "assignee": null, "receiverScore": { "delivered": 0, "rts": 0, "undelivered": 0, "rate": 0 }, "isBreach": false, "COD_AMOUNT": 1123123, "status": "active", "isDeleted": false, "ticketStatus": "none", "printedDates": [ "2022-09-15T10:30:37.562Z" ], "_id": "6322e2b3e120e6fdd6094d5b", "destinationMark": "", "ORDER_ID": "2209155C0E35", "SHIPPER_NAME": "address", "SHIPPER_CONTACT": "address", "RECEIVER_NAME": "12312", "RECEIVER_ADDR1": "12312", "RECEIVER_ADDR2": "", "RECEIVER_ADDR3": "", "RECEIVER_CITY": "SAMPANG", "RECEIVER_REGION": "JAWA TIMUR", "RECEIVER_PHONE": "123123", "ORIGIN_CODE": "CGK10000", "DESTINATION_CODE": "JI2401", "GOODS_DESC": "123123", "GOODS_AMOUNT": "150000", "RECEIVER_SUBDISTRICT": "BANYUATES", "RECEIVER_DISTRICT": "BANYUATES", "cnote_no": "0137812206123519", "user_id": "5fc6289532d4f232eb029ac8", "user": { "email": "[email protected]", "name": "Name" }, "batch": "22091515CCED71", "lastStatusChange": "2022-09-15T15:30:00.000Z", "receiver_id": "62fca167ad74ee28aa6ca3f6", "createdAt": "2022-09-15T08:30:43.310Z" } ] } ``` -------------------------------- ### Pay Unpaid Orders API Source: https://api-public.mengantar.com/docs/index Allows users to mark a batch of unpaid orders as paid. Requires the courier and batch ID. Returns the count of successfully paid orders. ```curl curl \ -X POST {BASE_URL}/api/public/{API_KEY}/order/pay-unpaid' \ -F 'courier=Sap' \ -F 'batch_id=6332f5b98c3ea4bc8e15f72d' ``` ```APIDOC POST {BASE_URL}/api/public/{API_KEY}/order/pay-unpaid Will return count of paid orders ``` ```JSON { "success": true, "count": 1 } ``` ```APIDOC Request Body Parameters: batch_id: String - Batch _id ``` -------------------------------- ### Delete Orders via API Source: https://api-public.mengantar.com/docs/index Demonstrates how to delete one or more orders using a DELETE request to the API. This operation requires specifying the courier and an array of order IDs in the request body. ```curl curl \ -X DELETE {BASE_URL}/api/public/{API_KEY}/order' \ -F 'courier=Sap' \ -F 'ids=["6332f9dfdeff6b0cae5e6c11", "6332f9dfdeff6b0cae5e6c12"]' ``` ```APIDOC DELETE {BASE_URL}/api/public/{API_KEY}/order Result example : { "success": true } ``` -------------------------------- ### Delete Batch via API Source: https://api-public.mengantar.com/docs/index Demonstrates how to delete a specific batch using a DELETE request to the API. This operation requires specifying the courier and the batch ID. ```curl curl \ -X DELETE {BASE_URL}/api/public/{API_KEY}/batch' \ -F 'courier=Sap' \ -F 'id=6332f9dfdeff6b0cae5e6c11' ``` ```APIDOC DELETE {BASE_URL}/api/public/{API_KEY}/batch Result example : { "success": true } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.