Petfen
  1. Order APIs
Petfen
  • Petfen-Account
    • APIs
      • Shipping Address
        • Get List Shipping Address
        • Get Detail Shipping Address
        • Get Default Address
        • Create Shipping Address
        • Update Shipping Address
        • Delete Shipping Addres
      • Seller
        • Verify Phone Number
        • Confirm Phone Number
        • Create Shop
        • Login
        • Renew Access Token Copy
        • Change Password Copy
        • Forgot Password Copy
        • Confirm Forgot Password Copy
        • Logout Copy
      • User Bag
        • Add Item To Bag
        • List Item In Bag
        • Use Item
        • Undo Item To Bag
      • User
        • Register
        • Confirm Register with OTP
        • Login
        • Renew Access Token
        • Change Password
        • Forgot Password
        • Verify OTP Forgot Password
        • Resend OTP Forgot Password
        • Confirm Forgot Password
        • Logout
        • Get Account Info
        • List Accounts
        • Update Account
      • Shop
        • Get shop info
        • Follow Shop
        • UnFollow Shop
    • CMS
  • Petfen-Product
    • CMS
      • Internal CMS
        • Product
      • Product
      • Category
      • FlashSale
        • Get List Flash Sale
        • Create Flash Sale
        • Update Flash Sale
        • Get Detail Flash Sale
    • Client
      • Flash Sale
        • Get List Flash Sale
        • Get List Flash Sale Active
        • Get Detail Flash Sale
      • Category
        • Get List Category
        • Get Detail Category
      • Add Wishlist
      • Remove Wishlist
      • Get List Product
      • Get Detail Product
      • Get Detail Product By Id
      • Add Review
      • Get List Review
      • Get Shipping Methods List
      • Get Review Distribution
      • Get Filter Data
    • Seller
      • Product
  • Petfen-Order
    • Order - Create
    • Order - Cancel
    • Order - Update
    • Order - List
    • Order - Detail
    • Cart - Sync
    • Cart - List
    • Order - Detail With Payment Id
    • Order statistic
  • Petfen-Payment
    • Request Payment
    • Confirm Payment
  • Petfen-voucher
    • Cms
      • Customer Group
        • Create Customer Group
        • Update Customer Group
        • Get Customer Group
        • Detail Customer Group
        • Delete Customer Group
      • Voucher
        • Create Voucher
        • Get Detail Voucher
        • Get List Voucher
    • Client
      • Get Voucher info
      • Get List Voucher
      • Get voucher code available
      • Calculate Discount
      • Check Voucher Valid
  • Petfen-Shipping
    • GHN
      • Delivery
        • Get Province
        • Get Station
        • Get Print Order Token
        • Print Order
        • Get District
        • Get Ward
        • Picking Shifts
        • Delivery Service
        • Calculate Delivery Fee
        • Calculate Expected Delivery Time
        • Create Order
        • Update Order
        • Cancel Order
        • Return Order
        • Get Order Info
        • Update COD
      • Support Ticket
        • Create Support Ticket
        • Get List Ticket
        • Get Ticket Detail
    • Service
      • Delivery
        • Get Province
        • Get District
        • Get Ward
        • Get Picking Shift
        • Get Order Info
        • Delivery Method
        • Calculate Delivery Fee
        • Calculate Expected Delivery Time
        • Create Order
        • Update Order
        • Cancel Order
        • Print Order
        • Return Order
        • Delivery Again
        • Update COD
      • Support Ticket
        • Create
        • Feedback
        • Get List
        • Get Detail
      • IPN Transaction
    • Ahamove
      • Order APIs
        • Estimate order fee with services
          POST
        • Estimate order fee with services
          POST
        • Estimate order fee with group services
          POST
        • Estimate order fee with group services
          POST
        • Create order by service ID
          POST
        • Create order by service ID
          POST
        • Create order by group service ID
          POST
        • Create order by group service ID
          POST
        • Cancel order by order_id
          DELETE
        • Cancel order by order_id
          DELETE
        • Cancel order by tracking_number
          DELETE
        • Cancel order by tracking_number
          DELETE
        • Get order detail
          GET
        • Get order detail
          GET
        • Get multiple order detail
          GET
        • Get multiple order detail
          GET
        • Get order list by tracking number
          GET
        • Get order list by tracking number
          GET
        • Get order tracking link
          GET
        • Get order tracking link
          GET
        • Get order callback logs
          GET
        • Get order callback logs
          GET
        • Update order Information
          PATCH
        • Update order Information
          PATCH
        • Rate a supplier
          PUT
        • Rate a supplier
          PUT
      • Master Data
        • Get cities
        • Get cities
        • Get list of services
        • Get list of services
        • Get service details
        • Get service details
      • Account APIs
        • Register account
        • Register account
        • Authenticate token
        • Authenticate token
        • Add child account
        • Add child account
        • Activate child account
        • Activate child account
        • Remove child account
        • Remove child account
        • Get child accounts list
        • Get child accounts list
        • Update user profile
        • Update user profile
    • Get list providers
      GET
    • Get list Provinces
      GET
    • Get list communes
      GET
    • Get list methods
      GET
  • Testing
  • Petfen-Invoice
    • S-Invoice
      • Login
      • SInvoice - Create invoice
      • SInvoice - Kê khai thuế
      • SInvoice - Lấy file hóa đơn chuyển đổi (pdf)
    • Partner
      • Auth Login
      • Create Invoice
      • Create Draft Invoice
      • Download Invoice File
      • Get Invoices
      • Cancel Invoice
      • Tax Declaration
      • Invoice Stat
      • Reconciliation
    • Service
      • Create Invoice
      • Update Invoice
      • Download Invoice
      • Cancel Invoice
      • Update Tax Declaration
      • Get Invoices
      • Get Invoice Stat
      • Reconciliation
  • Interal
    • Internal - Get access token
  1. Order APIs

Estimate order fee with group services

POST
/v3/orders/estimates

Estimate order fee#

Overview
This api is used to estimate order fee from multiple services for partner
Headers
KeyValueDescription
Content-Typeapplication/json
AuthorizationBearer {token}Partner token
JSON Body Format
* Service object
KeyTypeRequiredDescription
_idstringtrueService ID
requestsarraytrueList of special request object or []
* Stop point object
KeyTypeRequiredDescription
addressstringtrueText address
latfloattrueLatitude
lngfloattrueLongitude
namestringtrueName of receiver or sender
mobilestringtrueMobile phone of receiver or sender
codintfalseCOD amount in this stop point
formatted_addressstringfalseFormatted text address
short_addressstringfalseShort address text
address_codestringfalseAddress code
remarksstringfalseA note for supplier
item_valueintfalseItem's value
* Special request object
KeyTypeRequiredDescription
_idstringtrueID of the special request (e.g SGN-BIKE-TIPS)
numintfalseNumber of unit special request if it's PER_UNIT type
tier_codestringfalseCode of selected tier if it's TIER type
option_codestringfalseCode of selected option (e.g option in SGN-BIKE-FRAGILE
option_detailstringfalseOption detail of selected option
* Item object
KeyTypeRequiredDescription
_idinttrueItem ID
store_idinttrueStore ID
namestringtrueItem name
priceinttrueItem price
numinttrueNumber of item
* Body
KeyTypeRequiredDescription
patharraytrueList of stop point object
payment_methodstringtruePayment method to pay order
servicesarraytrueList of service object
order_timefloatfalseTime when user want to broadcast order to supplier
promo_codestringfalsePromo code to apply for discount
idle_untilfloatfalseTime when user want to broadcast order to supplier
itemsarrayfalseList of items to log in orders
Package detail
KeyTypeRequiredDescription
weightfloattrueItem weight (kg)
lengthfloatfalseItem length (m)
widthfloatfalseItem witdth (m)
heightfloatfalseItem height (m)
descriptiondescriptionfalseItem description
Response
* HTTP Code: 200
* JSON body format
* Service which can be estimated fee will have value in field data, field error is null. Otherwise, data is null and error is not null
[
  {
    "service_id": "SGN-BIKE",
    "data": {
      "distance": 11.6298,
      "duration": 3166,
      "user_main_account": 0,
      "user_bonus_account": 0,
      "currency": "VND",
      "total_pay": 72000,
      "polyline_points": "qmv`Agy_jSpFeBy@wB^y@{AqE`HqBuA}CZgBp@cb@j@iAYo@~Ksi@r@MJq@sBaAaNiVy@qDTaAsJaJfDoCkAsCfAk@q]_k@gn@ik@aBjBeCwBdCvBaG|G~DtDhNfCd`@f]hPpWwB~EjZxXU`AVtBxAdCsAdDB`AjOnNRbA_DlOgGdYo@h@b@rAm@j]MtDe@`AhPd^",
      "polylines": "qmv`Agy_jSpFeBy@wB^y@{AqE`HqBuA}CZgBp@cb@j@iAYo@~Ksi@r@MJq@sBaAaNiVy@qDTaAsJaJfDoCkAsCfAk@q]_k@gn@ik@aBjBeCwBdCvBaG|G~DtDhNfCd`@f]hPpWwB~EjZxXU`AVtBxAdCsAdDB`AjOnNRbA_DlOgGdYo@h@b@rAm@j]MtDe@`AhPd^",
      "total_balance": 0,
      "is_post_paid": false,
      "is_child_account": false,
      "online_pay": 0,
      "payment_method": "CASH",
      "distance_fee": 62000,
      "request_fee": 5000,
      "stop_fee": 5000,
      "vat_fee": 0,
      "discount": 0,
      "total_fee": 72000,
      "item_fee": 0,
      "item_vat_fee": 0,
      "item_discount": 0,
      "cod_commission_fee": 0,
      "requests": [
        {
          "_id": "SGN-BIKE-TIP",
          "num": 1,
          "price": 5000
        }
      ],
      "stoppoint_price": 5000,
      "special_request_price": 5000,
      "vat": 0,
      "distance_price": 62000,
      "voucher_discount": 0,
      "subtotal_price": 72000,
      "total_price": 72000,
      "surge_rate": 0
    },
    "error": null
  },
  {
    "service_id": "SGN-POOL",
    "data": null,
    "error": {
      "http_code": 406,
      "code": "INVALID_MAX_COD",
      "title": "COD is not valid",
      "description": "Rất tiếc, dịch vụ này chỉ hỗ trợ tổng COD tối đa đ{{ data.max_cod }}",
      "internal": ""
    }
  }
]
Error Responses
This explained the error field in each element of the response body
HTTP StatusCodeMeaning
406INVALID_FUTURE_ORDER_TIMEAdvanced booking time is not valid (e.g more than 1 month from now)
406NOT_SUPPORT_ADVANCE_BOOKINGService does not support advanced booking
406SERVICE_NOT_VALID_AT_PICKUPService does not available at the pickup point
406INVALID_PICKUP_AREAService does not available in this area
406INVALID_DELIVERY_AREAService does not support delivery in this area
400MISSING_PATH_INFOPath does not contain enough stop point
406INVALID_MAX_DISTANCEDistance violate max_distance configured in service
406INVALID_MAX_STOP_POINTNumber of stop point in path exceed max_stop_point of service
406INVALID_MIN_STOP_POINTNumber of stop point in path is less than min_stop_point of service
This explained the error for entirely request
HTTP StatusCodeMeaning
400BAD_REQUESTRequest contains invalid data

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json

Example
{
    "order_time": 0,
    "path": [
        {
            "lat": 10.76975346,
            "lng": 106.6636615,
            "address": "7/28 Thành Thái, Phường 14, Quận 10, Thành phố Hồ Chí Minh",
            "short_address": "Thành Thái, Quận 10",
            "name": "Lan",
            "mobile": "84944309348",
            "remarks": "Đến nơi lấy hàng đọc mã đơn để nhận hàng"
        },
        {
            "lat": 10.8018493,
            "lng": 106.714466,
            "address": "475A Điện Biên Phủ, Phường 25, Bình Thạnh, Thành phố Hồ Chí Minh",
            "short_address": "Đại Học Hutech, Quận Bình Thạnh, Hồ Chí Minh",
            "name": "Anh",
            "mobile": "0912345678",
            "cod": 100000,
            "item_value": 250000,
            "tracking_number": "ABCD1234",
            "remarks": "Gọi điện trước khi giao. Giao hàng cẩn thận"
        }
    ],
    "group_services": [
        {
            "_id": "BIKE",
            "group_requests": [
                {
                    "_id": "TIP",
                    "num": 1
                },
                {
                    "_id": "BULKY",
                    "tier_code": "TIER_2"
                }
            ]
        },
        {
            "_id": "ECO",
            "group_requests": []
        },
        {
            "_id": "TRUCK-2000",
            "group_requests": []
        },
        {
            "_id": "VNM-PARTNER-AHAMOVE",
            "group_requests": [
                {
                    "_id": "DONG-KIEM",
                    "num": 1
                }
            ]
        }
    ],
    "payment_method": "CASH",
    "remarks": "Ghi chú đơn hàng",
    "promo_code" : "AHMKM",
    "items": [
        {
            "_id": "TG",
            "num": 1,
            "name": "Tủ gỗ nhỏ",
            "price": 450000
        },
        {
            "_id": "GDB",
            "num": 2,
            "name": "Gương để bàn",
            "price": 120000
        }
    ],
    "package_detail": [
        {
            "weight": 10,
            "length": 1.2,
            "width": 0.8,
            "height": 2.0,
            "description": "Nội thất"
        }
    ]
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://partner-apistg.ahamove.com//v3/orders/estimates' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "order_time": 0,
    "path": [
        {
            "lat": 10.76975346,
            "lng": 106.6636615,
            "address": "7/28 Thành Thái, Phường 14, Quận 10, Thành phố Hồ Chí Minh",
            "short_address": "Thành Thái, Quận 10",
            "name": "Lan",
            "mobile": "84944309348",
            "remarks": "Đến nơi lấy hàng đọc mã đơn để nhận hàng"
        },
        {
            "lat": 10.8018493,
            "lng": 106.714466,
            "address": "475A Điện Biên Phủ, Phường 25, Bình Thạnh, Thành phố Hồ Chí Minh",
            "short_address": "Đại Học Hutech, Quận Bình Thạnh, Hồ Chí Minh",
            "name": "Anh",
            "mobile": "0912345678",
            "cod": 100000,
            "item_value": 250000,
            "tracking_number": "ABCD1234",
            "remarks": "Gọi điện trước khi giao. Giao hàng cẩn thận"
        }
    ],
    "group_services": [
        {
            "_id": "BIKE",
            "group_requests": [
                {
                    "_id": "TIP",
                    "num": 1
                },
                {
                    "_id": "BULKY",
                    "tier_code": "TIER_2"
                }
            ]
        },
        {
            "_id": "ECO",
            "group_requests": []
        },
        {
            "_id": "TRUCK-2000",
            "group_requests": []
        },
        {
            "_id": "VNM-PARTNER-AHAMOVE",
            "group_requests": [
                {
                    "_id": "DONG-KIEM",
                    "num": 1
                }
            ]
        }
    ],
    "payment_method": "CASH",
    "remarks": "Ghi chú đơn hàng",
    "promo_code" : "AHMKM",
    "items": [
        {
            "_id": "TG",
            "num": 1,
            "name": "Tủ gỗ nhỏ",
            "price": 450000
        },
        {
            "_id": "GDB",
            "num": 2,
            "name": "Gương để bàn",
            "price": 120000
        }
    ],
    "package_detail": [
        {
            "weight": 10,
            "length": 1.2,
            "width": 0.8,
            "height": 2.0,
            "description": "Nội thất"
        }
    ]
}'

Responses

🟢200Success
application/json
Body

Example
{}
Modified at 2025-09-24 02:04:55
Previous
Estimate order fee with group services
Next
Create order by service ID
Built with