Organization API: Billing & Payouts: Commerce
The 5 Organization API operations for commerce.
Part of Billing & Payouts.
Operations
Section titled Operations| Method | Path | Summary |
|---|---|---|
| GET | /api/v1/orgs/{org_slug}/commerce/affiliates/payouts |
The payouts the merchant recorded, newest first, for one affiliate or all of them |
| POST | /api/v1/orgs/{org_slug}/commerce/affiliates/{affiliate_id}/payouts |
Record a payout the merchant made; the referrals it names become paid |
| GET | /api/v1/orgs/{org_slug}/commerce/payouts |
List payouts |
| POST | /api/v1/orgs/{org_slug}/commerce/payouts |
Ask for the payable balance in a currency now |
| GET | /api/v1/orgs/{org_slug}/commerce/payouts/{payout_id} |
The payout and the ledger rows it holds, oldest first |
The payouts the merchant recorded, newest first, for one affiliate or all of them
Section titled The payouts the merchant recorded, newest first, for one affiliate or all of themGET /api/v1/orgs/{org_slug}/commerce/affiliates/payouts
The payouts the merchant recorded, newest first, for one affiliate or all of them.
Parameters
Section titled Parameters| Name | In | Type | Required | Description |
|---|---|---|---|---|
org_slug |
path | string | yes | |
affiliate_id |
query | integer or null | no | |
limit |
query | integer | no | Default: 50. |
offset |
query | integer | no | Default: 0. |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Record a payout the merchant made; the referrals it names become paid
Section titled Record a payout the merchant made; the referrals it names become paidPOST /api/v1/orgs/{org_slug}/commerce/affiliates/{affiliate_id}/payouts
Record a payout the merchant made; the referrals it names become paid.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
affiliate_id |
path | integer | yes |
org_slug |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
amount |
Amount | yes | Minor units; the referrals' commissions add up to it. |
currency_code |
Currency Code | yes | |
method |
any or null | no | How it was paid, such as bank_transfer. |
reference |
any or null | no | |
note |
any or null | no | |
referral_ids |
Referral Ids | yes | The affiliate's unpaid referrals this pays. |
Responses
Section titled Responses| Status | Meaning |
|---|---|
201 |
Success. |
422 |
The request is not valid. detail lists each problem. |
List payouts
Section titled List payoutsGET /api/v1/orgs/{org_slug}/commerce/payouts
Newest first, with summary: the schedule and, per currency, what is
payable now, the minimum and any payout still open.
Parameters
Section titled Parameters| Name | In | Type | Required | Description |
|---|---|---|---|---|
org_slug |
path | string | yes | |
status |
query | string or null | no | A status, or open for both open ones. |
currency_code |
query | string or null | no | |
limit |
query | integer | no | Default: 50. |
offset |
query | integer | no | Default: 0. |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Ask for the payable balance in a currency now
Section titled Ask for the payable balance in a currency nowPOST /api/v1/orgs/{org_slug}/commerce/payouts
Ask for the payable balance in a currency now. 409 with error
nothing_payable, below_minimum, payout_open or held when
there is none to make; the balance carries.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
org_slug |
path | string | yes |
Idempotency-Key |
header | string or null | no |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
currency_code |
string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
201 |
Success. |
422 |
The request is not valid. detail lists each problem. |
The payout and the ledger rows it holds, oldest first
Section titled The payout and the ledger rows it holds, oldest firstGET /api/v1/orgs/{org_slug}/commerce/payouts/{payout_id}
The payout and the ledger rows it holds, oldest first.
Parameters
Section titled Parameters| Name | In | Type | Required | Description |
|---|---|---|---|---|
payout_id |
path | string | yes | |
org_slug |
path | string | yes | |
limit |
query | integer | no | Ledger rows per page. Default: 100. |
offset |
query | integer | no | Default: 0. |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |