ApiResourcesAffiliates

Create an affiliate payout

Atomically reserve eligible referrals for an affiliate payout.

Send a unique Idempotency-Key header. Replaying the same key for the same affiliate returns the original payout. Reusing it for another affiliate is rejected.

POST
/v2/affiliates/{affiliate}/payouts

Authorization

bearerAuth storeAuth
AuthorizationBearer <token>

Provide your SellApp API key as a bearer token.

In: header

X-STORE<token>

Select the SellApp store for this API request.

In: header

Path Parameters

affiliate*integer

The affiliate path parameter.

Header Parameters

Idempotency-Key*string

A caller-generated key, unique per store and affiliate payout operation.

Lengthlength <= 100

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://sell.app/api/v2/affiliates/0/payouts" \  -H "Idempotency-Key: string"
{
  "data": {
    "id": 0,
    "affiliate_id": 0,
    "affiliate_email": "user@example.com",
    "amount_usd_cents": 0,
    "status": "due",
    "payout_method": "string",
    "payout_account": "string",
    "referrals_count": 0,
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
{
  "data": {
    "id": 0,
    "affiliate_id": 0,
    "affiliate_email": "user@example.com",
    "amount_usd_cents": 0,
    "status": "due",
    "payout_method": "string",
    "payout_account": "string",
    "referrals_count": 0,
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
{
  "message": "Unauthenticated."
}
{
  "message": "This action is unauthorized."
}
{
  "message": "Rule not found."
}
{
  "message": "The given data was invalid.",
  "errors": {
    "data": [
      "The data field is required."
    ]
  }
}