GET
/
affiliate
/
brands
cURL
curl --request GET \
  --url https://api-beta.lomadee.com.br/affiliate/brands \
  --header 'x-api-key: <api-key>'
[
  {
    "data": {
      "id": "<string>",
      "logo": "<string>",
      "name": "<string>",
      "slug": "<string>",
      "site": "<string>",
      "channels": [
        {
          "id": "<string>",
          "name": "<string>",
          "availableChannel": {
            "id": "<string>",
            "name": "<string>"
          },
          "shortUrls": [
            "<string>"
          ],
          "message": "<string>"
        }
      ],
      "commission": {
        "value": 123,
        "transfer": "<string>"
      }
    },
    "meta": {
      "total": 123,
      "page": 123,
      "limit": 123,
      "totalPages": 123
    }
  }
]

Get all Brands

Retrieve a comprehensive list of all affiliate brands available in the Lomadee network. This endpoint provides detailed brand information including logos, commission rates, and available channels.

HTTP Request

GET https://api-beta.lomadee.com.br/affiliate/brands

Query Parameters

limit
integer
The maximum number of results to return
page
integer
The page number to return
organizationId
string
The organization id to return brands from
organizationIds
array
The organization ids to return brands from
mdasc
boolean
This parameter is used to filter brands by additional identifier. Return all brands has this identifier if set to true.

Example Requests

Basic Request

curl -X GET "https://api-beta.lomadee.com.br/affiliate/brands" \
  -H "x-api-key: your-api-key"

With Pagination

curl -X GET "https://api-beta.lomadee.com.br/affiliate/brands?page=1&limit=20" \
  -H "x-api-key: your-api-key"

Filter by Organization

curl -X GET "https://api-beta.lomadee.com.br/affiliate/brands?organizationId=e36f5bbb-3e5f-42e2-be4c-6c32dac101c2" \
  -H "x-api-key: your-api-key"

Response Format

data
array
Array of brand objects
meta
object
Pagination metadata

Brand Object Structure

id
string
The unique identifier of the brand
The logo URL of the brand
name
string
The name of the brand
slug
string
The URL-friendly slug of the brand
site
string
The website URL of the brand
commission
object
Commission information for the brand
channels
array
Available affiliate channels for the brand

Example Response

{
  "data": [
    {
      "id": "e36f5bbb-3e5f-42e2-be4c-6c32dac101c2",
      "logo": "https://example.com/logo.png",
      "name": "Example Brand",
      "slug": "example-brand",
      "site": "https://example.com",
      "commission": {
        "value": 4.2,
        "transfer": "cpa"
      },
      "channels": [
        {
          "id": "channel-1",
          "name": "Main Channel",
          "availableChannel": {
            "id": "available-1",
            "name": "Available Channel"
          },
          "shortUrls": ["https://lomadee.com/short-url-1"],
          "message": null
        }
      ]
    }
  ],
  "meta": {
    "total": 150,
    "page": 1,
    "limit": 10,
    "totalPages": 15
  }
}

Error Responses

401 Unauthorized

{
  "message": "API key is required",
  "error": "Unauthorized",
  "statusCode": 401
}

500 Internal Server Error

{
  "message": "Internal server error",
  "error": "InternalServerError",
  "statusCode": 500
}

Usage Examples

JavaScript/Node.js

const axios = require("axios");

async function getBrands() {
  try {
    const response = await axios.get(
      "https://api-beta.lomadee.com.br/affiliate/brands",
      {
        headers: {
          "x-api-key": "your-api-key",
        },
        params: {
          page: 1,
          limit: 20,
        },
      }
    );

    console.log("Brands:", response.data.data);
    console.log("Pagination:", response.data.meta);
  } catch (error) {
    console.error("Error:", error.response.data);
  }
}

Python

import requests

def get_brands():
    url = 'https://api-beta.lomadee.com.br/affiliate/brands'
    headers = {'x-api-key': 'your-api-key'}
    params = {
        'page': 1,
        'limit': 20
    }

    response = requests.get(url, headers=headers, params=params)

    if response.status_code == 200:
        data = response.json()
        print('Brands:', data['data'])
        print('Pagination:', data['meta'])
    else:
        print('Error:', response.json())

PHP

<?php
$url = 'https://api-beta.lomadee.com.br/affiliate/brands';
$headers = ['x-api-key: your-api-key'];

$params = [
    'page' => 1,
    'limit' => 20
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url . '?' . http_build_query($params));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode === 200) {
    $data = json_decode($response, true);
    echo 'Brands: ' . print_r($data['data'], true);
    echo 'Pagination: ' . print_r($data['meta'], true);
} else {
    echo 'Error: ' . $response;
}
?>

Best Practices

  1. Pagination: Always implement pagination for large datasets
  2. Caching: Cache brand data when appropriate (TTL: 60 seconds)
  3. Commission Tracking: Use commission information to calculate earnings
  4. Channel Management: Check channel availability before generating links
  5. Error Handling: Implement proper error handling for all responses
  6. Rate Limiting: Respect the 10 requests per minute limit

Common Use Cases

  • Brand Directory: Display available affiliate brands
  • Commission Analysis: Compare commission rates across brands
  • Channel Management: Check available channels for each brand
  • Link Generation: Generate affiliate links for specific brands
  • Performance Tracking: Monitor brand performance and earnings

Authorizations

x-api-key
string
header
required

Query Parameters

limit
integer

The maximum number of results to return

page
integer

The page number to return

Response

Brand response

The response is of type object[].