- list - List all commissions
- create - Create commission
- update - Update a commission
- update_many - Bulk update commissions
Retrieve a paginated list of commissions for your partner program.
from dub import Dub
with Dub(
token="DUB_API_KEY",
) as d_client:
res = d_client.commissions.list(request={
"ending_before": "cm_1KAP4CGN2Z5TPYYQ1W4JEYD56",
"starting_after": "cm_1KAP4CGN2Z5TPYYQ1W4JEYD56",
"page": 1,
"page_size": 50,
})
while res is not None:
# Handle items
res = res.next()| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.ListCommissionsRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.ListCommissionsResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequest | 400 | application/json |
| errors.Unauthorized | 401 | application/json |
| errors.Forbidden | 403 | application/json |
| errors.NotFound | 404 | application/json |
| errors.Conflict | 409 | application/json |
| errors.InviteExpired | 410 | application/json |
| errors.UnprocessableEntity | 422 | application/json |
| errors.RateLimitExceeded | 429 | application/json |
| errors.InternalServerError | 500 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Create one or more commissions (custom, lead or sale) for a partner. Commission creation is processed asynchronously. Use the List Commissions endpoint or webhooks to be notified when the commission is created.
from dub import Dub
with Dub(
token="DUB_API_KEY",
) as d_client:
res = d_client.commissions.create()
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.CreateCommissionRequestBody | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.CreateCommissionResponseBody
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequest | 400 | application/json |
| errors.Unauthorized | 401 | application/json |
| errors.Forbidden | 403 | application/json |
| errors.NotFound | 404 | application/json |
| errors.Conflict | 409 | application/json |
| errors.InviteExpired | 410 | application/json |
| errors.UnprocessableEntity | 422 | application/json |
| errors.RateLimitExceeded | 429 | application/json |
| errors.InternalServerError | 500 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Update an existing commission amount. This is useful for handling refunds (partial or full) or fraudulent sales.
from dub import Dub
with Dub(
token="DUB_API_KEY",
) as d_client:
res = d_client.commissions.update(request={
"id": "cm_1JVR7XRCSR0EDBAF39FZ4PMYE",
})
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.UpdateCommissionRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.UpdateCommissionResponseBody
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequest | 400 | application/json |
| errors.Unauthorized | 401 | application/json |
| errors.Forbidden | 403 | application/json |
| errors.NotFound | 404 | application/json |
| errors.Conflict | 409 | application/json |
| errors.InviteExpired | 410 | application/json |
| errors.UnprocessableEntity | 422 | application/json |
| errors.RateLimitExceeded | 429 | application/json |
| errors.InternalServerError | 500 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Bulk update up to 100 commissions with the same status.
from dub import Dub
with Dub(
token="DUB_API_KEY",
) as d_client:
res = d_client.commissions.update_many()
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.BulkUpdateCommissionsRequestBody | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
List[operations.BulkUpdateCommissionsResponseBody]
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequest | 400 | application/json |
| errors.Unauthorized | 401 | application/json |
| errors.Forbidden | 403 | application/json |
| errors.NotFound | 404 | application/json |
| errors.Conflict | 409 | application/json |
| errors.InviteExpired | 410 | application/json |
| errors.UnprocessableEntity | 422 | application/json |
| errors.RateLimitExceeded | 429 | application/json |
| errors.InternalServerError | 500 | application/json |
| errors.SDKError | 4XX, 5XX | */* |