Get a List of downline Resellers
There are two API methods to get the list of downstream Resellers:
- Get the downline resellers list
GET
{base_url}/api/v3/resellers/{reseller_id}/child_resellers
- Get Resellers List
GET {base_url}/customer_store/resellers/
Each method returns the same list of downstream Resellers.
The Get the downline resellers list method doesn't require the Customer Store module, while the Get Resellers List method requires installed Customer Store (see Managing Storefront).
Get the downline resellers list
The Get the downline resellers list method returns the list of all downstream Resellers with respect to the current Reseller, or with respect to any of its downstream Resellers.
Access to the current Reseller and downstream Resellers is determined by the Manager's token in the API request.
You can view the list of Resellers page by page. To request a page with the list of Resellers, provide the following arguments:
- the page number (page);
- the number of items per page (per_page).
GET {base_url}/api/v3/resellers/{reseller_id}/child_resellers
Arguments
Name | Parameter Type | Data type | Required/Optional | Description |
---|---|---|---|---|
X-Api-Token | header | string | Required | API token of the Manager that performs the operation (see Viewing and updating manager's information) |
Content-Type | header | string | Required | Indicates the media type (text/html or text/JSON) of the response that is sent to the client by the server |
Accept | header | string | Required | Information about data types that the client (browser) supports |
reseller_id | path | integer | Required | ID of the current Reseller or any of its downstream Resellers (see Viewing and updating reseller general information) |
page | query | integer | Optional | Sets the page number |
per_page | query | integer | Optional | Sets the number of Plans per page |
Response model
See below response model of the Get Resellers List method.
Request example
GET http://reseller.activeplatform.com/api/v3/resellers/33/child_resellers
Accept: application/vnd.api+json
Content-Type: application/vnd.api+json
X-Api-Token:qQwW12
Response example
See below an example of response for the Get Resellers List method.
Get Resellers List
The Get Resellers List method returns the list of all downstream Resellers with respect to the current Reseller.
The list of downstream Resellers is generated with respect to the current Reseller that is defined by the Manager's token in the API request.
You can view the list of Resellers page by page. To request a page with the list of Resellers, provide the following arguments:
- the page number (page);
- the number of items per page (per_page).
GET {base_url}/customer_store/resellers/
Arguments
Name | Parameter Type | Data type | Required/ | Description |
---|---|---|---|---|
api_token | query | string | Required | API token of the Manager that performs the operation (see Viewing and updating manager's information) |
page | query | integer | Optional | Returning the list of Resellers at the page with the specified number. |
per_page | query | integer | Optional | Setting a number of items in the page. |
Response model
Name | Data type | Description | ||
---|---|---|---|---|
id | string | Reseller ID | ||
type | string | Data type | ||
attributes | object | Reseller information | ||
parent-id | string | Upline (parent) Reseller ID | ||
created-at | date | Date and time of the Reseller creation | ||
updated-at | date | Date and time of the last update of the Reseller information | ||
general | object | Model of the general information about the Reseller | ||
name | string | Reseller name | ||
domain | string | Reseller domain | ||
currency | string | Reseller currency in the ISO 4217 alfa-3 format | ||
manager | string | Manager that is attached to the Reseller | ||
company | object | Model of the information about the Reseller company | ||
name | string | Company name | ||
address-line-1 | string | First line of the company address | ||
address-line-2 | string | Second line of the company address | ||
city | string | City, in which the company is situated | ||
state | string | State, in which the company is situated | ||
zip | string | Zip-code of the company | ||
country | string | Company country code according to ISO 3166-1 alpha-2 standard | ||
phone | string | Phone number of the company:
| ||
fax | string | Company fax number | ||
string | Company email | |||
contacts | object | Information about Reseller contact person | ||
first-name | string | First name of the company contact person | ||
last-name | string | Last name of the company contact person | ||
middle-name | string | Middle name of the company contact person | ||
position | string | Position of the company contact person | ||
phone | string | Phone number of the company contact person:
| ||
string | Company contact person's email | |||
attributes.custom-attributes | object | Reseller Attributes | ||
attributes.custom-attributes['custom-attribute-key'] | string | Reseller Attribute value |
Request example
curl -X GET -H "Content-Type: application/vnd.api+json" -H "Accept: application/vnd.api+json" -H "X-Api-Token: G2dYuBK44dgYu90id1122e" http://billing.activeplatform.com/api/v3/customer_store/resellers/
Response example
{
"data": [
{
"id": "1",
"type": "resellers",
"attributes": {
"created-at": "2017-06-09T15:44:51.694+03:00",
"updated-at": "2017-12-22T16:38:53.600+03:00",
"parent-id": 1,
"general": {
"name": "Company 1",
"domain": "cn1.billing.activeplatform.com",
"manager": "Manager 1",
"currency": "USD"
},
"company": {
"name": "Company name 1",
"address-line-1": "Nezalezhnosty av., 1",
"address-line-2": "Sovietsky distr.",
"city": "Minsk",
"state": "Minskaya",
"zip": "220000",
"country": "BY",
"fax": "+375170345678",
"phone": "+375290468624",
"email": "company@example.com"
},
"contacts": {
"first-name": "Ivan",
"last-name": "Petrov",
"middle-name": "Ivanovich",
"position": "Sales representative",
"phone": "+375290468624",
"email": "petrov.company@example.com"
},
"custom-attributes": {
"1c password ": "password",
"1c api name ": "1c api",
"kpp": "234342617111",
"inn": "23411113234",
"reseller pin": "1234"
}
}
},
{
"id": "2",
"type": "resellers",
"attributes": {
"created-at": "2017-06-12T17:41:51.694+03:00",
"updated-at": "2017-12-24T10:38:53.600+03:00",
"parent-id": 1,
"general": {
"name": "Company 2",
"domain": "cn2.billing.activeplatform.com",
"manager": "Manager 2",
"currency": "USD"
},
"company": {
"name": "Company name 2",
"address-line-1": "Nezalezhnosty av., 2",
"address-line-2": "Sovietsky distr.",
"city": "Minsk",
"state": "Minskaya",
"zip": "220000",
"country": "BY",
"fax": "+375172545458",
"phone": "+375292968624",
"email": "company2@example.com"
},
"contacts": {
"first-name": "Petr",
"last-name": "Ivanov",
"middle-name": "Ivanovich",
"position": "Sales representative",
"phone": "+375290478626",
"email": "ivanov.company2@example.com"
},
"custom-attributes": {
"1c password ": "password",
"1c api name ": "1c api",
"kpp": "444342617931",
"inn": "55411113276",
"reseller pin": "4321"
}
}
}
],
"links": {
"self": "http://billing.activeplatform.com/api/v3/customer_store/resellers?page%5Bnumber%5D=1&page%5Bsize%5D=50",
"next": "http://billing.activeplatform.com/api/v3/customer_store/resellers?page%5Bnumber%5D=2&page%5Bsize%5D=50",
"last": "http://billing.activeplatform.com/api/v3/customer_store/resellers?page%5Bnumber%5D=5&page%5Bsize%5D=50"
}
}