To get all buyers with pagination.
https://access.way2order.com/api/v1/getbuyers
Content-Type: application/json
Authorization: Bearer {access_token}
The following query parameters are available
Parameter | Description | |
---|---|---|
sort | Sort Order | Refer 'Sort Fields' below |
page | Page Number | Default 1 |
per_page | Records per Page | Default 25, Maximum 100 |
The query parameters are to be appended to the endpoint. To get 20 buyers from page 2, sorted by 'dt_create' in ascending (ASC) order, the endpoint with the query parameters will be
https://access.way2order.com/api/v1/getbuyers?sort=dt_create&page=2&per_page=20
The following sort fields are available
ASC Order | DESC Order | |
---|---|---|
dt_create | -dt_create | Default |
dt_update | -dt_update | |
dt_approval | -dt_approval |
{
"data": [
{
"_id": "5bc875bcf9b0da3f12f97809",
"buyer_id": "590",
"contactinfo": {
"name": "B.S.Sharma",
"company": "Bliss Enterprises",
"initials": "BLISS",
"address1": "57 Railway Road",
"address2": "",
"city": "New Delhi",
"state": "New Delhi",
"zip": "110001",
"country": "IN",
"email": "",
"contact": "9464700320",
"profilepic": "https://cdn.way2order.com/profilepics/others/b.png",
"gstin": "03ABCDE1234F1ZZ"
},
"distributor": false,
"groupexists": true,
"dt_approval": "2018-10-18T13:00:22.004Z",
"dt_create": "2018-10-18T12:05:56.259Z",
"dt_update": "2018-12-12T13:10:25.299Z",
"id": "5bc875bcf9b0da3f12f97809"
},
...
],
"pagination": {
"page": 1,
"per_page": 25,
"total_pages": 21,
"total_elements": 519
}
}
Attribute | Type | Description |
---|---|---|
_id | String | ID of the Buyer |
buyer_id | String | Buyer ID (ObjectId / Primary Key from your existing software / database) |
contactinfo | Object | Buyer's Contact Information |
distributor | Boolean | true if Buyer is your Distributor, false otherwise |
groupexists | Boolean | true if Buyer has a Way2Order Account, false otherwise |
dt_approval | Date | Date on which the Buyer Request was approved |
dt_create | Date | Buyer Creation Date |
dt_update | Date | Buyer Last Updation Date |
id | String | ID of the Buyer |
The 'pagination' Object in the response contains the following information
Property | Details |
---|---|
page | Current Page Number |
per_page | Records per Page |
total_pages | Total Number of Pages |
total_elements | Total Records |