List Merchants Service
import ApiDoc from '../../../../../src/components/api-doc/ApiDoc';
After getting the token or signature in the previous step, the virtual store may consume the store list service
Call details
- Resource:
/v1/merchants - HTTP Method:
GET - Request format:
query string - Response format:
JSON - Header parameters:
| Parameter | Description | Format | Mandatory |
|---|---|---|---|
merchant_id | Merchant code on Carat Portal. The production and certification codes will be different. | < 15 AN | YES |
merchant_key | Merchant authentication key on Carat Portal. The production and certification keys will be different. | < 80 AN | YES |
token | Token obtained on the token creation service. Learn more. | = 66 AN | NO |
Authorization | The merchant's signature must be sent in the format Bearer {signature}. Exemple: Bearer JHVGytfdgauygdauiw78264284527852897hagdg. | < 2000 AN | NO |
Example
Store list using token
Request:
To use this example, don't forget to define the variable {{url}} to the value
curl
--request GET "https://{{url}}/e-sitef/api/v1/merchants?cnpj=12345678901234&merchant_status=A&page=1&limit=1"
--header "Content-Type: application/json"
--header "merchant_id: xxxxxxxx"
--header "merchant_key: xxxxxxxxxxx"
--header "token: 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr"
--verbose
Store list using signature
Request:
To use this example, don't forget to define the variable {{url}} to the value
curl
--request GET "https://{{url}}/e-sitef/api/v1/merchants?cnpj=12345678901234&merchant_status=A&page=1&limit=1"
--header "Content-Type: application/json"
--header "merchant_id: xxxxxxxx"
--header "merchant_key: xxxxxxxxxxx"
--header "Authorization: Bearer YYYYYYY"
--verbose
Response:
{
"response_code": "0",
"response_message": "OK",
"current_page": "0",
"total_pages": "1",
"count": "1",
"merchants": [
{
"id": "qereIoinsd3d",
"merchant_status": "A",
"fantasy_name": "Teste de Loja",
"corporate_name": "Testes de Loja Ltda.",
"cnpj": "12345678901234"
}
]
}
Request parameters
| Parâmetro | Descrição | Formato | Obrigatório |
|---|---|---|---|
cnpj | CNPJ of the merchant. Numbers only. | = 14 N | Não |
merchant_status | Store status. Can assume the following values: A = Active I = Inactive | = 1 N | Não |
page | List Page. The first page value is 0. If not set, defaults to 0. | < 4 N | Não |
limit | Max records by page. If not set, defaults to 100. | < 3 N | Não |
Response parameters
If successful, the HTTP response code will be 200. Any other code must be interpreted as an error.
| Parameter | Description | Format |
|---|---|---|
response_code | Carat Portal response code. Any code different from 0 means failure. | < 4 N |
response_message | Carat Portal response message. | < 500 AN |
current_page | Current records page. | < 4 N |
total_pages | Total pages number. | < 4 N |
count | Total register count. | < 4 N |
| merchants[] | Store list returned by the query. | |
id | Code of the created merchant. | < 15 AN |
merchant_status | Store status. Can assume the following values: A = Active I = Inactive | = 1 N |
fantasy_name | Fantasy name of the merchant. | < 250 AN |
corporate_name | Corporate name of the merchant. | < 250 AN |
cnpj | CNPJ of the merchant. Numbers only. | = 14 N |
Updated 2 months ago