Add New
Add new order
Add new sales order
HTTP Request
[POST] /api/v6/sale_orders
Body Parameters
| Parameter | Type | Default | Nullable | Require | Description |
|---|---|---|---|---|---|
| account_id | integer | yes | Customer identifier | ||
| account_code | string | yes | Customer code | ||
| account_name | string | yes | Customer name | ||
| account_address | string | yes | Customer address | ||
| account_email | string | yes | Customer email | ||
| account_phone | integer | yes | Customer phone number | ||
| order_date | timestamp | yes | Order date | ||
| discount | numeric | Discount percentage | |||
| discount_amount | numeric | Discount amount | |||
| vat | numeric | VAT percentage | |||
| vat_amount | numeric | VAT amount | |||
| transport | numeric | Shipping fee percentage | |||
| transport_amount | numeric | Shipping fee amount | |||
| installation | numeric | Installation fee percentage | |||
| installation_amount | numeric | Installation fee amount | |||
| src_id | integer | Source identifier | |||
| assigned_user | integer | Order executor | |||
| saved_order_details | array | yes | Product list | ||
| saved_order_details.*.id | integer | yes | Product identifier in order | ||
| saved_order_details.*.product_id | integer | yes | Product identifier | ||
| saved_order_details.*.price | numeric | yes | Product price | ||
| saved_order_details.*.quantity | integer | yes | Product quantity | ||
| saved_order_details.*.product_sale_off | numeric | yes | Product discount | ||
| saved_order_details.*.cash_discount | numeric | yes | Cash discount | ||
| saved_order_details.*.note | string | yes | Product description | ||
| order_terms | array | yes | Order terms | ||
| order_terms.*.id | integer | yes | Term identifier | ||
| order_terms.*.term_content | string | yes | Term content | ||
| custom_fields | object | yes | Data definition |
Example
HTTP Request
POST api/v6/sale_orders HTTP/1.1
Host: example.getflycrm.com
Content-Type: application/json
{
"account_id": 1,
"order_date": 1701229899,
"saved_order_details": [
{
"product_id": 1,
"quantity": 1,
"price": 100
}
]
}
Status
200 OK
Response
{
"message": "Successfully added",
"id": 4
}
Add new purchase order
HTTP Request
[POST] /api/v6/purchase_orders
Body Parameters
| Parameter | Type | Default | Nullable | Require | Description |
|---|---|---|---|---|---|
| account_id | integer | yes | Customer identifier | ||
| account_code | string | yes | Customer code | ||
| account_name | string | yes | Customer name | ||
| account_address | string | yes | Customer address | ||
| account_email | string | yes | Email khách hàng | ||
| account_phone | integer | yes | Customer phone number | ||
| order_date | timestamp | yes | Order date | ||
| discount | numeric | Discount percentage | |||
| discount_amount | numeric | Discount amount | |||
| vat | numeric | VAT percentage | |||
| vat_amount | numeric | VAT amount | |||
| transport | numeric | Shipping fee percentage | |||
| transport_amount | numeric | Shipping fee amount | |||
| installation | numeric | Installation fee percentage | |||
| installation_amount | numeric | Installation fee amount | |||
| src_id | integer | Source identifier | |||
| saved_order_details | array | yes | Product list | ||
| saved_order_details.*.id | integer | yes | Product identifier in order | ||
| saved_order_details.*.product_id | integer | yes | Product identifier | ||
| saved_order_details.*.price | numeric | yes | Product price | ||
| saved_order_details.*.quantity | integer | yes | Product quantity | ||
| saved_order_details.*.product_sale_off | numeric | yes | Product discount | ||
| saved_order_details.*.cash_discount | numeric | yes | Cash discount | ||
| saved_order_details.*.note | string | yes | Product description | ||
| order_terms | array | yes | Order terms | ||
| order_terms.*.id | integer | yes | Term identifier | ||
| order_terms.*.term_content | string | yes | Term content | ||
| custom_fields | object | yes | Data definition |
Example
HTTP Request
POST api/v6/purchase_orders HTTP/1.1
Host: example.getflycrm.com
Content-Type: application/json
{
"account_id": 1,
"order_date": 1701229899,
"saved_order_details": [
{
"product_id": 1,
"quantity": 1,
"price": 100
}
]
}
Status
200 OK
Response
{
"message": "Thêm mới thành công",
"id": 4
}