Баримт бичиг / API лавлах

Шимтгэл

Олсон шимтгэл ба түүний төлөв.

GET/v1/workspaces/{workspaceId}/commissions

Commissions, newest first by default.

Шаардлагатай API түлхүүрийн хамрах хүрээ: commissions.read

Параметр (21)
НэрБайрлалТөрөлЗаавалТайлбар
workspaceIdpathstringтийм
typequerystringComma list of click, lead, sale, referral, custom; a `-` prefix excludes.
customerIdquerystring
payoutIdquerystring
bountySubmissionIdquerystring
partnerIdquerystringComma list of partner ids; `-` excludes. Wins over `tenantId`.
tenantIdquerystring
groupIdquerystring
partnerTagIdquerystring
invoiceIdquerystring
statusquerystring
sortByquerystring`createdAt` (default) or `amount`.
sortOrderquerystring`desc` (default) or `asc`.
intervalquerystring24h, 7d, 30d, 90d, 1y, mtd, qtd, ytd, all (default).
startquerystring
endquerystring
timezonequerystring
queryquerystring`metadata['key']='value'`.
pageSizequeryinteger (int32)
startingAfterquerystring
endingBeforequerystring

Хариу: 200 Commission[]

POST/v1/workspaces/{workspaceId}/commissions

Queue a commission (custom, lead or sale). Returns 202; the commission appears shortly after, failures of the queued step are listed by GET .../commissions/failures.

Шаардлагатай API түлхүүрийн хамрах хүрээ: commissions.write

Параметр (1)
НэрБайрлалТөрөлЗаавалТайлбар
workspaceIdpathstringтийм
Хүсэлтийн бие (CreateCommission)
НэрТөрөлЗаавалТайлбар
typestringтийм`custom`, `lead` or `sale`.
partnerIdstringтийм
amountinteger (int64)custom: whole MNT, negative = clawback.
datestring (date-time)
descriptionstringcustom: max 190 characters; required for a clawback.
customerIdstring
customernull | CustomerInput
linkIdstring
discountCodestring
leadnull | LeadInput
salenull | SaleInput

Хариу: 202 Queued

PATCH/v1/workspaces/{workspaceId}/commissions

Bulk status edit; paid commissions are rejected and reported, the rest still apply (R29).

Шаардлагатай API түлхүүрийн хамрах хүрээ: commissions.write

Параметр (1)
НэрБайрлалТөрөлЗаавалТайлбар
workspaceIdpathstringтийм
Хүсэлтийн бие (BulkUpdate)
НэрТөрөлЗаавалТайлбар
idsstring[]тиймAt most 100 commission ids.
statusstringтийм
reasonstring

Хариу: 200 BulkResult[]

GET/v1/workspaces/{workspaceId}/commissions/count

Counts and sums per status, type, partner or group, with the list filters.

Шаардлагатай API түлхүүрийн хамрах хүрээ: commissions.read

Параметр (22)
НэрБайрлалТөрөлЗаавалТайлбар
workspaceIdpathstringтийм
typequerystringComma list of click, lead, sale, referral, custom; a `-` prefix excludes.
customerIdquerystring
payoutIdquerystring
bountySubmissionIdquerystring
partnerIdquerystringComma list of partner ids; `-` excludes. Wins over `tenantId`.
tenantIdquerystring
groupIdquerystring
partnerTagIdquerystring
invoiceIdquerystring
statusquerystring
sortByquerystring`createdAt` (default) or `amount`.
sortOrderquerystring`desc` (default) or `asc`.
intervalquerystring24h, 7d, 30d, 90d, 1y, mtd, qtd, ytd, all (default).
startquerystring
endquerystring
timezonequerystring
queryquerystring`metadata['key']='value'`.
pageSizequeryinteger (int32)
startingAfterquerystring
endingBeforequerystring
groupByquerystring`status` (default), `type`, `partnerId`, `groupId`.

Хариу: 200 CountRow[]

POST/v1/workspaces/{workspaceId}/commissions/export

Start the CSV export; a download link is emailed (valid 7 days). 202.

Шаардлагатай API түлхүүрийн хамрах хүрээ: commissions.read

Параметр (1)
НэрБайрлалТөрөлЗаавалТайлбар
workspaceIdpathstringтийм
Хүсэлтийн бие (ExportBody)
НэрТөрөлЗаавалТайлбар
columnsarrayColumns in order; default `shortLink, url, clicks, createdAt`.
fromstring (date-time)Only links created at or after / before these instants.
tostring (date-time)
filtersnull | Filters

Хариу: 202 ExportStarted

GET/v1/workspaces/{workspaceId}/commissions/exports/{jobId}/download

Download a finished export.

Шаардлагатай API түлхүүрийн хамрах хүрээ: commissions.read

Параметр (2)
НэрБайрлалТөрөлЗаавалТайлбар
workspaceIdpathstringтийм
jobIdpathstringтийм

Хариу: 200

GET/v1/workspaces/{workspaceId}/commissions/failures

Failures of queued creations (reason code, request id), newest first.

Шаардлагатай API түлхүүрийн хамрах хүрээ: commissions.read

Параметр (1)
НэрБайрлалТөрөлЗаавалТайлбар
workspaceIdpathstringтийм

Хариу: 200 Failure[]

GET/v1/workspaces/{workspaceId}/commissions/{commissionId}

One commission.

Шаардлагатай API түлхүүрийн хамрах хүрээ: commissions.read

Параметр (2)
НэрБайрлалТөрөлЗаавалТайлбар
workspaceIdpathstringтийм
commissionIdpathstringтийм

Хариу: 200 Commission

PATCH/v1/workspaces/{workspaceId}/commissions/{commissionId}

Edit a commission: status, earnings or sale amount (unpaid only). processed and paid cannot be set by the API.

Шаардлагатай API түлхүүрийн хамрах хүрээ: commissions.write

Параметр (2)
НэрБайрлалТөрөлЗаавалТайлбар
workspaceIdpathstringтийм
commissionIdpathstringтийм
Хүсэлтийн бие (UpdateCommission)
НэрТөрөлЗаавалТайлбар
earningsinteger (int64)Overrides the computed earnings (min 0; negative only for clawbacks).
saleAmountinteger (int64)
modifySaleAmountinteger (int64)Signed; wins over `saleAmount`.
currencystringOnly `mnt`.
statusstringpending, refunded, duplicate, canceled, fraud, hold. Wins over the amounts.
reasonstringShown to the partner in the update notification.
applyToRelationshipbooleanWith `fraud` or `canceled`: apply to every unpaid commission of the (customer, partner) pair and stop future earnings from that customer (R32).

Хариу: 200 Commission

GET/v1/workspaces/{workspaceId}/commissions/{commissionId}/activity

Activity log of a commission (status and amount changes, R31).

Шаардлагатай API түлхүүрийн хамрах хүрээ: commissions.read

Параметр (2)
НэрБайрлалТөрөлЗаавалТайлбар
workspaceIdpathstringтийм
commissionIdpathstringтийм

Хариу: 200 Activity[]