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

Create order by service ID

POST
/v3/orders

Create new order for parttner#

Overview
This api is used to create an order for partner
Headers
KeyValueDescription
Content-Typeapplication/json
AuthorizationBearer {token}Partner token
JSON Body
Body
KeyTypeRequiredDescription
service_idstringtrueService ID
patharraytrueList of stop points
requestsarraytrueList of special requests
payment_methodstringtruePayment method to pay order
total_payintfalseAmount of cash user have to pay, value getting from the estimating fee step
order_timefloatfalseTime when user want to broadcast order to supplier
promo_codestringfalsePromo code to apply for discount
remarksstringfalseUser remarks for supplier
admin_notestringfalseNote from AHM for supplier
route_optimizedbooleanfalseTrue means user want to rearrange the stop point in path for cost optimization
idle_untilfloatfalseTime when user want to broadcast order to supplier. It is used in scheduled order
itemsarrayfalseList of items
package_detailarrayfalseList of package detail
group_service_idstringfalseBased on group_service_id, Ahamove will detect proper service id by pickup location
group_requestsarrayfalseList of group request, based on every item in group_requests, Ahamove will detect proper special request based on group id
Stop point model
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_valueint64falseItem's value
Special request model
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
Group request model
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 model
KeyTypeRequiredDescription
_idinttrueItem ID
namestringtrueItem name
priceinttrueItem price
numinttrueNumber of item
Package detail
KeyTypeRequiredDescription
weightfloattrueItem weight (kg)
lengthfloatfalseItem length (m)
widthfloatfalseItem width (m)
heightfloatfalseItem height (m)
descriptiondescriptionfalseItem description
Response
* HTTP Code: 200
* JSON body format
{
    "order_id": "21H8E7JM",
    "status": "ASSIGNING",
    "shared_link": "https://cloudstg.ahamove.com/share-order/21H8E7JM/84944309347",
    "order": {
        // order detail
        ...
    }
}
Error Responses
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
406INVALID_SERVICE_HOURService does not available at the moment
400MISSING_PATH_INFOPath does not contain enough stop point
406INVALID_MAX_DISTANCEDistance violate max_distance configured in service
406INVALID_MAX_CODOrder COD exceed max_cod of service or user max_cod
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
406NOT_ENOUGH_CREDITUser does not have enough AHM credit
406TOTAL_PAY_NOT_VALIDValue of total_pay passed by client does not match the order total_pay

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"
        }
    ],
    "service_id": "SGN-BIKE",
    "requests": [
        {
            "_id": "SGN-BIKE-TIP",
            "num": 1
        },
        {
            "_id": "SGN-BIKE-BULKY",
            "tier_code": "TIER_2"
        }
    ],
    "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' \
--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"
        }
    ],
    "service_id": "SGN-BIKE",
    "requests": [
        {
            "_id": "SGN-BIKE-TIP",
            "num": 1
        },
        {
            "_id": "SGN-BIKE-BULKY",
            "tier_code": "TIER_2"
        }
    ],
    "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
Create order by service ID
Next
Create order by group service ID
Built with