2. API get order

a. ist of order or details of order via id on Ant CRM

URL: https://apiring.antbuddy.com/opportunities

Method: GET

Content-Type: application/json

Parameters

Type

Required

Explain

number

string

Id of opportunity

page

number

Page number, maximum 20 Order per page

limit

number

Number of records per page

phones

string

Phone number of the related customer

customerId

string

ID of the related customer

Results returned:

Parameters

Type

Required

Explain

name

string

AND

Trading name

receiverName

string

AND

Customer name

opportunityIdApiRing

string

Code orders

dealByUsers

array

Officer in charge. For example: [“[email protected]”]

dealWith

receiverPhone

Object

string

{

“customerId”: “123”,

“name”: “thong”,

“phones”: [{type: “Work”, value: “023232”}],

“customerIdApiRing”: “Customer Id” }

Customer phone number

HTTP Response Code: 200

Response:

[
  {
    "_id": "672aeafb392be6610aa6ecc0",
    "receiverAddressObj": {
      "street": "",
      "streetName": "",
      "city": "",
      "state": "",
      "wards": "",
      "cityCode": "",
      "stateCode": "",
      "wardsCode": "",
      "zip": "",
      "country": {
        "code": "VN",
        "name": "Vietnam"
      }
    },
    "normalize": "",
    "status": "LOST",
    "description": "",
    "dealBy": {
      "users": [],
      "groups": []
    },
    "contacts": [],
    "shipping_cost": 0,
    "value": 3000000,
    "discount": 0,
    "quantity": 1,
    "canEdit": false,
    "typeDiscount": 0,
    "currency": "VND",
    "coupons": [],
    "package": [],
    "files": [],
    "inActive": false,
    "dealId": "",
    "isCreatedByConvertLead": false,
    "isSampleData": false,
    "totalPayment": 0,
    "tags": [],
    "cusFields": [],
    "deferredDate": null,
    "timeDelivery": null,
    "stage": "672aeae1176c0a60e758996c",
    "permit": {
      "status": 1,
      "groups": []
    },
    "name": "Test",
    "dealWith": {
      "_id": "671eefdb171a8c2a7cb980ee",
      "contactType": "customer",
      "lastname": "",
      "name": "Thuận Trần",
      "phones": [
        {
          "type": "Work",
          "_id": "671eefdb171a8c2a7cb980ef",
          "value": "0349767037"
        }
      ],
      "emails": [],
      "customerId": 2
    },
    "receiverName": "Nghĩa Antbuddy",
    "receiverAddress": "Vietnam",
    "receiverPhone": "0349767038",
    "groupPackage": [],
    "category": "672add3c392be6610aa6856d",
    "subCategory": null,
    "subSubCategory": null,
    "closeDate": 1733504398999,
    "typeTimeDelivery": null,
    "createdBy": "671eeb8a3e1b267430cedcac",
    "org": "671eeb8b3e1b267430cedcaf",
    "createdAt": 1730865915015,
    "stageUpdatedAt": 1730865915015,
    "payments": [],
    "updatedAt": 1748850720184,
    "number": 1,
    "__v": 0
  }
]

b. Add order

URL: https://apiring.antbuddy.com/opportunities

Method: POST

Content-Type: application/json

receiverAddressObj

object

Customer address. For example: {

city: "Ho Chi Minh City",

state: "Tan Binh district", street: "3", //(apartment number) streetName: "Nguyen Kiem",

wards: "Ward 12",

"country": {

"code": "VN",

"name": "Vietnam"

}

}

Record the same as the address on the system.

groupPackage

array

Information line. For example:

[

{ name: "Beef combo", // product name quantity: 1, // quantity

typeDiscount: 1, (0: cash, 1: percent) // type of discount discount: 10, // discount amount or % discount value: 1000, // Product price productIdApiRing: “1”, // product id note: "Grilled beef" // Note, code: “Sku” // Product code

}

]

Note:

- The combo name and product in the combo must match the corresponding combo and product name

value

number

Value of the order. If there is no value, the system will calculate the value of the order according to the price on the system.

receiverNote

string

Delivery notes

description

string

order description

stage

string

order status

branch

string

Store or branch name

cusFields

array

AntCRM custom fields. [

{

name: "Shipping unit", value: “Fast delivery”

}

]

Results returned:

createdAt

Number

Creation time

Type: Timestamp

shipping_cost

Number

Shipping Fee

HTTP Response Code: 200

Response:

{

"success": 1,

"number”: 9457 (id of order on antcrm) }

c. Edit order

URL: https://apiring.antbuddy.com/opportunities

Method: PUT

Content-Type: application/json

Parameters

Type

Required

Explain

number

string

AND

id on crm

name

string

Trading name

receiverName

string

Customer name

receiverPhone

string

Customer phone number

receiverAddress Obj

groupPackage

object

array

Customer address. For example: {

city: "Ho Chi Minh City",

state: "Tan Binh district", street: "3", //(apartment number) streetName: "Nguyen Kiem",

wards: "Ward 12",

"country": {

"code": "VN",

"name": "Vietnam"

}

}

Record the same as the address on the system.

Information line. For example:

[

{ name: "Beef combo", // product name quantity: 1, // quantity

typeDiscount: 1, (0: cash, 1: percent) //

type of discount discount: 10, // discount amount or % discount value: 1000, // Product price productIdApiRing: “1”, // product id note: "Grilled beef" // Note, code: “Sku” // Product code

}

]

Note:

- The combo name and product in the combo must match the corresponding combo and product name on the system.

value

number

Value of the order. If there is no value, the system will calculate the value of the order according to the price on the system.

receiverNote

string

Delivery notes

description

string

order description

stage

string

order status

branch

string

Store or branch name

cusFields

array

Custom fields on AntCRM.

[

{

name: "Shipping unit", value: “Fast delivery”

}

]

shipping_cost

Number

Shipping fee

Results returned:

HTTP Response Code: 200

Response:

{

"success": 1,

"number”: 9457 (id of order on antcrm) }

d. Delete order

URL: https://apiring.antbuddy.com/opportunities

Method: DELETE

Content-Type: application/json

number

string

A

N

D

id of the order on antcrm

Results returned: HTTP Response Code: 200

Response:

{

"success": 1 }

e. Add bulk order

URL:https://apiring.antbuddy.com/opportunities/package

Method: POST

Content-Type: application/json

Limit 100 orders per request

Body: [{order data A}, {order data B}]

Parameters

Type

Required

Explain

name

string

AND

Trading name

receiverName

string

AND

Customer name

opportunityIdApiRing

string

Code orders

dealByUsers

array

Officer in charge. For example: [“[email protected]”]

dealWith

receiverPhone

Object

string

{

“customerId”: “123”,

“name”: “thong”,

“phones”: [{type: “Work”, value: “023232”}],

“customerIdApiRing”: “Customer Id” }

Customer phone number

receiverAddressObj

object

Customer address. For example: {

city: "Ho Chi Minh City",

state: "Tan Binh district", street: "3", //(apartment number) streetName: "Nguyen Kiem",

wards: "Ward 12",

"country": {

"code": "VN",

"name": "Vietnam"

}

}

Record the same as the address on the system.

groupPackage

array

Information line. For example:

[

{name: "Beef combo", // product name quantity: 1, // quantity typeDiscount: 1, (0: cash, 1: percent) //

type of discount discount: 10, // discount amount or % discount value: 1000, // Product price productIdApiRing: “1”, // product id note: "Grilled beef" // Note, code: “Sku” // Product code

}

]

Note:

- The combo name and product in the combo must match the corresponding combo and product name on the system.

Value of the order. If there is no value, the system will calculate the value of the order according to the price on the system.

value

number

The order value. If no value is provided, the system will calculate the order value based on the system's pricing

receiverNote

number

Delivery notes

description

string

order description

stage

string

order status

branch

string

Store or branch name

cusFields

array

Custom fields on AntCRM.

[

{ name: "Shipping unit", value: “Fast delivery”

}

]

createdAt

Number

Creation time

Type: Timestamp

shipping_cost

Number

Shipping fee

Results returned: HTTP Response Code: 200

Response:

{

"success": 1,

"number”: [9457, 9458, 9459] (antcrm order id) }

f. Edit a bulk of oder

URL: https://apiring.antbuddy.com/opportunities/package

Method: PUT

Content-Type: application/json Limit 100 orders per request

Body: [{order data A}, {order data B}]

Parameters

Type

Required

Explain

number

string

AND

id on crm

name

string

Trading name

receiverName

string

Customer name

receiverPhone

string

Customer phone number

receiverAddress Obj

groupPackage

object

array

Customer address. For example: {

city: "Ho Chi Minh City",

state: "Tan Binh district", street: "3", //(apartment number) streetName: "Nguyen Kiem",

wards: "Ward 12",

"country": {

"code": "VN",

"name": "Vietnam"

}

}

Record the same as the address on the system.

Information line. For example:

[

{ name: "Beef combo", // product name quantity: 1, // quantity typeDiscount: 1, (0: cash, 1: percent) // type

of discount discount: 10, // discount amount or % discount value: 1000, // Product price productIdApiRing: “1”, // product id note: "Grilled beef" // Note,

code: “Sku” // Product code

}

]

Note:

- The combo name and product in the combo must match the corresponding combo and product name on the system.

value

number

Value of the order . If there is no value, the system will calculate the value of the order according to the price on the system.

receiverNote

string

Delivery notes

description

string

order description

stage

string

order status

branch

string

Store or branch name

cusFields

array

AntCRM custom fields.

[

{ name: "Shipping unit", value: “Fast delivery”

}

]

shipping_cost

Number

Shipping Fee

Results returned:

HTTP Response Code: 200

Response:

{

"success": 1,

"number”: [9457, 9458] (antcrm order id) }

Last updated