POST
/
partners
Go
package main

import(
	"context"
	dubgo "github.com/dubinc/dub-go"
	"github.com/dubinc/dub-go/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := dubgo.New(
        dubgo.WithSecurity("DUB_API_KEY"),
    )

    res, err := s.Partners.Create(ctx, &operations.CreatePartnerRequestBody{
        Email: "Summer50@yahoo.com",
        LinkProps: &operations.LinkProps{
            ExternalID: dubgo.String("123456"),
            TagIds: dubgo.Pointer(operations.CreateCreatePartnerTagIdsArrayOfStr(
                []string{
                    "clux0rgak00011...",
                },
            )),
            TestVariants: []operations.CreatePartnerTestVariants{
                operations.CreatePartnerTestVariants{
                    URL: "https://example.com/variant-1",
                    Percentage: 50,
                },
                operations.CreatePartnerTestVariants{
                    URL: "https://example.com/variant-2",
                    Percentage: 50,
                },
            },
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}
{
  "id": "<string>",
  "name": "<string>",
  "email": "<string>",
  "image": "<string>",
  "description": "<string>",
  "country": "<string>",
  "paypalEmail": "<string>",
  "stripeConnectId": "<string>",
  "payoutsEnabledAt": "<string>",
  "programId": "<string>",
  "groupId": "<string>",
  "partnerId": "<string>",
  "tenantId": "<string>",
  "createdAt": "<string>",
  "status": "pending",
  "links": [
    {
      "id": "<string>",
      "domain": "<string>",
      "key": "<string>",
      "shortLink": "<string>",
      "url": "<string>",
      "clicks": 0,
      "leads": 0,
      "sales": 0,
      "saleAmount": 0
    }
  ],
  "totalCommissions": 0,
  "clickRewardId": "<string>",
  "leadRewardId": "<string>",
  "saleRewardId": "<string>",
  "discountId": "<string>",
  "applicationId": "<string>",
  "bannedAt": "<string>",
  "bannedReason": "tos_violation",
  "clicks": 0,
  "leads": 0,
  "conversions": 0,
  "sales": 0,
  "saleAmount": 0,
  "netRevenue": 0,
  "website": "<string>",
  "websiteTxtRecord": "<string>",
  "websiteVerifiedAt": "<string>",
  "youtube": "<string>",
  "youtubeVerifiedAt": "<string>",
  "youtubeSubscriberCount": 123,
  "youtubeViewCount": 123,
  "twitter": "<string>",
  "twitterVerifiedAt": "<string>",
  "linkedin": "<string>",
  "linkedinVerifiedAt": "<string>",
  "instagram": "<string>",
  "instagramVerifiedAt": "<string>",
  "tiktok": "<string>",
  "tiktokVerifiedAt": "<string>"
}
Partners endpoints require an Advanced plan subscription or higher.

Authorizations

Authorization
string
header
required

Default authentication mechanism

Body

application/json
email
string<email>
required

The partner's email address. Partners will be able to claim their profile by signing up at partners.dub.co with this email.

Required string length: 1 - 190
name
string | null

The partner's full name. If undefined, the partner's email will be used in lieu of their name (e.g. john@acme.com)

Maximum length: 100
username
string | null

The partner's unique username in your system (max 100 characters). This will be used to create a short link for the partner using your program's default domain. If not provided, Dub will try to generate a username from the partner's name or email.

Maximum length: 100
image
string | null

The partner's avatar image. If not provided, a default avatar will be used.

tenantId
string

The partner's unique ID in your system. Useful for retrieving the partner's links and stats later on. If not provided, the partner will be created as a standalone partner.

groupId
string

The group ID to add the partner to. If not provided, the partner will be added to the default group.

country
string | null

The partner's country of residence. Must be passed as a 2-letter ISO 3166-1 country code. See https://d.to/geo for more information.

description
string | null

A brief description of the partner and their background. Max 5,000 characters.

Maximum length: 5000

Additional properties that you can pass to the partner's short link. Will be used to override the default link properties for this partner.

Response

The created partner

id
string
required

The partner's unique ID on Dub.

name
string
required

The partner's full legal name.

Maximum length: 190
email
string | null
required

The partner's email address. Should be a unique value across Dub.

Maximum length: 190
image
string | null
required

The partner's avatar image.

country
string | null
required

The partner's country (required for tax purposes).

paypalEmail
string | null
required

The partner's PayPal email (for receiving payouts via PayPal).

stripeConnectId
string | null
required

The partner's Stripe Connect ID (for receiving payouts via Stripe).

payoutsEnabledAt
string | null
required

The date when the partner enabled payouts.

programId
string
required

The program's unique ID on Dub.

partnerId
string
required

The partner's unique ID on Dub.

tenantId
string | null
required

The partner's unique ID within your database. Can be useful for associating the partner with a user in your database and retrieving/update their data in the future.

createdAt
string
required
status
enum<string>
required

The status of the partner's enrollment in the program.

Available options:
pending,
approved,
rejected,
invited,
declined,
banned,
archived

The partner's referral links in this program.

totalCommissions
number
default:0
required

The total commissions paid to the partner for their referrals. Defaults to 0 if includeExpandedFields is false.

clicks
number
default:0
required

The total number of clicks on the partner's links. Defaults to 0 if includeExpandedFields is false.

leads
number
default:0
required

The total number of leads generated by the partner's links. Defaults to 0 if includeExpandedFields is false.

conversions
number
default:0
required

The total number of leads that converted to paying customers. Defaults to 0 if includeExpandedFields is false.

sales
number
default:0
required

The total number of sales generated by the partner's links (includes recurring sales). Defaults to 0 if includeExpandedFields is false.

saleAmount
number
default:0
required

The total amount of sales (in cents) generated by the partner's links. Defaults to 0 if includeExpandedFields is false.

netRevenue
number
default:0
required

The total net revenue generated by the partner. Defaults to 0 if includeExpandedFields is false.

description
string | null

A brief description of the partner and their background.

Maximum length: 5000
groupId
string | null

The partner's group ID on Dub.

clickRewardId
string | null
leadRewardId
string | null
saleRewardId
string | null
discountId
string | null
applicationId
string | null

If the partner submitted an application to join the program, this is the ID of the application.

bannedAt
string | null

If the partner was banned from the program, this is the date of the ban.

bannedReason
enum<string> | null

If the partner was banned from the program, this is the reason for the ban.

Available options:
tos_violation,
inappropriate_content,
fake_traffic,
fraud,
spam,
brand_abuse
website
string | null

The partner's website URL (including the https protocol).

websiteTxtRecord
string | null
websiteVerifiedAt
string | null
youtube
string | null

The partner's YouTube channel username (e.g. johndoe).

youtubeVerifiedAt
string | null
youtubeSubscriberCount
number | null
youtubeViewCount
number | null
twitter
string | null

The partner's Twitter username (e.g. johndoe).

twitterVerifiedAt
string | null
linkedin
string | null

The partner's LinkedIn username (e.g. johndoe).

linkedinVerifiedAt
string | null
instagram
string | null

The partner's Instagram username (e.g. johndoe).

instagramVerifiedAt
string | null
tiktok
string | null

The partner's TikTok username (e.g. johndoe).

tiktokVerifiedAt
string | null