GET
/
affiliate
/
brands
/
{id}
cURL
curl --request GET \
  --url https://api-beta.lomadee.com.br/affiliate/brands/{id} \
  --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 a Brand

Retrieve detailed information about a specific affiliate brand by its ID. This endpoint provides comprehensive brand data including commission rates, available channels, and brand details.

HTTP Request

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

Path Parameters

id
string
The unique identifier of the brand to retrieve

Example Requests

Basic Request

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

Response Format

data
object
Brand object with detailed information
meta
object
Response 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
      },
      {
        "id": "channel-2",
        "name": "Secondary Channel",
        "availableChannel": {
          "id": "available-2",
          "name": "Secondary Available Channel"
        },
        "shortUrls": ["https://lomadee.com/short-url-2"],
        "message": null
      }
    ]
  },
  "meta": {
    "total": 1,
    "page": 1,
    "limit": 1,
    "totalPages": 1
  }
}

Error Responses

404 Not Found

{
  "message": "Brand not found",
  "error": "NotFound",
  "statusCode": 404
}

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 getBrand(brandId) {
  try {
    const response = await axios.get(
      `https://api-beta.lomadee.com.br/affiliate/brands/${brandId}`,
      {
        headers: {
          "x-api-key": "your-api-key",
        },
      }
    );

    console.log("Brand:", response.data.data);
    console.log("Commission:", response.data.data.commission);
    console.log("Channels:", response.data.data.channels);
  } catch (error) {
    console.error("Error:", error.response.data);
  }
}

// Usage
getBrand("e36f5bbb-3e5f-42e2-be4c-6c32dac101c2");

Python

import requests

def get_brand(brand_id):
    url = f'https://api-beta.lomadee.com.br/affiliate/brands/{brand_id}'
    headers = {'x-api-key': 'your-api-key'}

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

    if response.status_code == 200:
        data = response.json()
        brand = data['data']
        print('Brand:', brand['name'])
        print('Commission:', brand['commission'])
        print('Channels:', brand['channels'])
    else:
        print('Error:', response.json())

# Usage
get_brand("e36f5bbb-3e5f-42e2-be4c-6c32dac101c2")

PHP

<?php
function getBrand($brandId) {
    $url = "https://api-beta.lomadee.com.br/affiliate/brands/{$brandId}";
    $headers = ['x-api-key: your-api-key'];

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    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);
        $brand = $data['data'];
        echo 'Brand: ' . $brand['name'] . "\n";
        echo 'Commission: ' . print_r($brand['commission'], true) . "\n";
        echo 'Channels: ' . print_r($brand['channels'], true) . "\n";
    } else {
        echo 'Error: ' . $response;
    }
}

// Usage
getBrand("e36f5bbb-3e5f-42e2-be4c-6c32dac101c2");
?>

Best Practices

  1. Error Handling: Always handle 404 errors for invalid brand IDs
  2. Caching: Cache brand data when appropriate (TTL: 60 seconds)
  3. Commission Calculation: Use commission data to calculate potential earnings
  4. Channel Validation: Check channel availability before generating links
  5. Rate Limiting: Respect the 10 requests per minute limit

Common Use Cases

  • Brand Details: Display detailed information about a specific brand
  • Commission Analysis: Analyze commission rates for specific brands
  • Channel Management: Check available channels for a specific brand
  • Link Generation: Generate affiliate links for a specific brand
  • Performance Tracking: Monitor performance metrics for individual brands

Authorizations

x-api-key
string
header
required

Path Parameters

id
integer
required

ID of brand to return

Response

Brand response

The response is of type object.