Перейти к основному содержимому

Resellers API

POST /resellers

Description

This API endpoint retrieves a list of all resellers.

Request Body

The request uses GraphQL to perform the resellers query, which does not require any variables.

Query:

query resellers {
resellers {
id
email
firstName
lastName
credit
level
phone
}
}

GraphQL Variables:

{}

Example Request:

curl --location '' \
--header 'Content-Type: application/json' \
--data '{"query":"query resellers {\n resellers {\n id\n email\n firstName\n lastName\n credit\n level\n phone\n }\n}","variables":{}}'

Response:

  • Success (200 OK):

    • The response includes a list of all resellers with their details.
    {
    "data": {
    "resellers": [
    {
    "id": 1,
    "email": "reseller1@example.com",
    "firstName": "John",
    "lastName": "Doe",
    "credit": 5000,
    "level": "Gold",
    "phone": "+1234567890"
    },
    {
    "id": 2,
    "email": "reseller2@example.com",
    "firstName": "Jane",
    "lastName": "Smith",
    "credit": 3000,
    "level": "Silver",
    "phone": "+0987654321"
    }
    // More resellers...
    ]
    }
    }
  • Error (4XX/5XX):

    • If there is an issue with the request or server error, the response will include an error message and status code.

Note:

This endpoint returns a complete list of resellers, including their IDs, email addresses, names, credit balances, levels, and phone numbers. Ensure your system handles potentially large lists if many resellers are present.