Affilibee
Toggle sidebar

Get a segment

API reference for retrieving a single segment by its UUID for the authenticated merchant.

Endpoint

GET
/api/v2/segments/{uuid}

Authorization

Learn more
Authorization
string
header
required

The Bearer token generated in the Affilibee dashboard.

Body

application/json

uuid
string
required

The unique UUID of the segment.

Example requests

curl -X GET "https://affilibee.com/api/v2/segments/98a7b6c5-d4e3-f2g1-h0i9-j8k7l6m5n4o3" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Accept: application/json"
const token = "YOUR_ACCESS_TOKEN";
const uuid = "98a7b6c5-d4e3-f2g1-h0i9-j8k7l6m5n4o3";
const url = `https://affilibee.com/api/v2/segments/${uuid}`;

const response = await fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
    "Accept": "application/json"
  }
});

const data = await response.json();
console.log(data);
import requests

token = "YOUR_ACCESS_TOKEN"
uuid = "98a7b6c5-d4e3-f2g1-h0i9-j8k7l6m5n4o3"
url = f"https://affilibee.com/api/v2/segments/{uuid}"

response = requests.get(
    url,
    headers={
        "Authorization": f"Bearer {token}",
        "Accept": "application/json",
    },
)

print(response.json())
<?php

require 'vendor/autoload.php';

use GuzzleHttp\Client;

$token = 'YOUR_ACCESS_TOKEN';
$uuid = '98a7b6c5-d4e3-f2g1-h0i9-j8k7l6m5n4o3';

$client = new Client([
    'base_uri' => 'https://affilibee.com/api/v2/',
    'headers' => [
        'Authorization' => "Bearer $token",
        'Accept' => 'application/json',
    ],
]);

$response = $client->get("segments/$uuid");

echo $response->getBody();
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        using var client = new HttpClient();
        var uuid = "98a7b6c5-d4e3-f2g1-h0i9-j8k7l6m5n4o3";
        var url = $"https://affilibee.com/api/v2/segments/{uuid}";
        var token = "YOUR_ACCESS_TOKEN";

        client.DefaultRequestHeaders.Add("Authorization", $"Bearer {token}");
        client.DefaultRequestHeaders.Add("Accept", "application/json");

        var response = await client.GetAsync(url);
        var content = await response.Content.ReadAsStringAsync();

        Console.WriteLine(content);
    }
}

Responses

application/json

200
Success

Returned when the segment is successfully retrieved.

404
Not Found

Returned when the segment does not exist or does not belong to the authenticated merchant.

Response examples

{
    "success": true,
    "data": {
        "segment": {
            "uuid": "98a7b6c5-d4e3-f2g1-h0i9-j8k7l6m5n4o3",
            "name": "Default",
            "description": "Default segment for all products.",
            "type": {
                "name": "Percentage",
                "slug": "percentage"
            },
            "slugs": ["default"],
            "skus": [],
            "tiers": [
                {
                    "name": "Standard Tier",
                    "slug": "standard-tier",
                    "rate": 10,
                    "visual_rate": "10%"
                }
            ],
            "created_at": "2026-03-20T10:00:00Z",
            "updated_at": "2026-03-20T10:00:00Z"
        }
    },
    "errors": null,
    "meta": {
        "trace_id": "20260321:api:abc12"
    }
}
{
    "success": false,
    "data": null,
    "errors": {
        "message": [
            "Not Found"
        ]
    },
    "meta": {
        "trace_id": "20260321:api:abc12"
    }
}

Notes

  • Only segments associated with your merchant account can be retrieved.

  • If the segment does not exist or does not belong to your merchant account, a 404 error will be returned.

Got questions? We're here for you.

We help teams run affiliate programs through API-first integrations that fit the platform they already use.

© 2025 Affilibee Handelsbolag (969802-2481)

Integrations

API Integration
How can we assist you today?

Fill in the form below and we'll get back to you as soon as possible.

Name
Email
Message