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-TokenheaderstringRequiredAPI token of the Manager that performs the operation (see Viewing and updating manager's information)
Content-TypeheaderstringRequiredIndicates the media type (text/html or text/JSON) of the response that is sent to the client by the server
AcceptheaderstringRequired

Information about data types that the client (browser) supports

reseller_idpathintegerRequiredID 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/
Optional

Description

api_tokenquerystringRequiredAPI 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

NameData typeDescription
idstringReseller ID
typestringData type
attributesobjectReseller information

parent-idstringUpline (parent) Reseller ID

created-atdateDate and time of the Reseller creation

updated-atdateDate and time of the last update of the Reseller information

generalobjectModel of the general information about the Reseller


namestringReseller name


domainstringReseller domain


currencystringReseller currency in the ISO 4217 alfa-3 format


managerstringManager that is attached to the Reseller

companyobjectModel of the information about the Reseller company


namestringCompany name


address-line-1stringFirst line of the company address


address-line-2stringSecond line of the company address


citystringCity, in which the company is situated


statestringState, in which the company is situated


zipstringZip-code of the company


countrystringCompany country code according to ISO 3166-1 alpha-2 standard


phonestring

Phone number of the company:

  • + < country code > < city code or network code > < phone number >
  • 00 < country code > < city code or network code > < phone number >


faxstringCompany fax number


emailstringCompany email

contactsobjectInformation about Reseller contact person


first-namestringFirst name of the company contact person


last-namestringLast name of the company contact person


middle-namestringMiddle name of the company contact person


positionstringPosition of the company contact person


phonestring

Phone number of the company contact person:

  • + < country code > < city code or network code > < phone number >
  • 00 < country code > < city code or network code > < phone number >


emailstringCompany contact person's email

attributes.custom-attributesobjectReseller Attributes


attributes.custom-attributes['custom-attribute-key']stringReseller 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"
    }
}