POST
/
partners
from dub import Dub


with Dub(
    token="DUB_API_KEY",
) as d_client:

    res = d_client.partners.create(request={
        "program_id": "<id>",
        "name": "<value>",
        "email": "Summer50@yahoo.com",
        "link_props": {
            "external_id": "123456",
            "tag_ids": [
                "clux0rgak00011...",
            ],
            "test_variants": [
                {
                    "url": "https://example.com/variant-1",
                    "percentage": 50,
                },
                {
                    "url": "https://example.com/variant-2",
                    "percentage": 50,
                },
            ],
        },
    })

    assert res is not None

    # Handle response
    print(res)
{
  "id": "<string>",
  "name": "<string>",
  "email": "<string>",
  "image": "<string>",
  "description": "<string>",
  "country": "<string>",
  "website": "<string>",
  "youtube": "<string>",
  "twitter": "<string>",
  "linkedin": "<string>",
  "instagram": "<string>",
  "tiktok": "<string>",
  "paypalEmail": "<string>",
  "stripeConnectId": "<string>",
  "payoutsEnabledAt": "<string>",
  "createdAt": "<string>",
  "status": "pending",
  "programId": "<string>",
  "tenantId": "<string>",
  "links": [
    {
      "id": "<string>",
      "domain": "<string>",
      "key": "<string>",
      "shortLink": "<string>",
      "url": "<string>",
      "clicks": 0,
      "leads": 0,
      "sales": 0,
      "saleAmount": 0
    }
  ],
  "clicks": 0,
  "leads": 0,
  "sales": 0,
  "saleAmount": 0,
  "totalCommissions": 0,
  "netRevenue": 0,
  "earnings": 0
}

Partners endpoints require an Advanced plan subscription or higher.

Authorizations

Authorization
string
header
required

Default authentication mechanism

Body

application/json

Response

201
application/json

The created partner

The response is of type object.