Overview
SDKs
- Overview
- Server-side SDKs
- Client-side SDK
- Embedded Dashboards
APIs
- Links API
- Analytics API
- Conversions API
- Partners API
- Customers API
- Commissions API
- Folders API
- Tags API
- Domains API
Partners API
Create a partner
Create a partner for a program. If partner exists, automatically enrolls them.
POST
/
partners
Copy
Ask AI
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{
Name: "<value>",
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
}
}
Copy
Ask AI
{
"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
Default authentication mechanism
Body
application/json
Response
201
application/json
The created partner
The response is of type object
.
Copy
Ask AI
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{
Name: "<value>",
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
}
}
Copy
Ask AI
{
"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
}
Assistant
Responses are generated using AI and may contain mistakes.