DotsDocs
Payout agents

Update a Payout Agent

Update a payout agent's name or rules. Only the fields you send change. Payouts the agent already sent are unaffected: spending cap usage is always computed from the payouts themselves, so lowering or replacing caps never resets usage.

PATCH
/v2/payout-agents/{payout_agent_id}

Update a payout agent's name or rules. Only the fields you send change. Payouts the agent already sent are unaffected: spending cap usage is always computed from the payouts themselves, so lowering or replacing caps never resets usage.

Authorization

api_key
headerAuthorizationBasic <token>

Path Parameters

payout_agent_id*string

ID of the payout agent.

Formatuuid

Request Body

application/json
  1. body
Properties1 <= properties
name?string

Name of the payout agent.

Length1 <= length <= 255
max_payout_amount?|

Maximum principal of a single payout, in cents. null removes the limit.

Range0 < value
spending_caps?array<>

Replaces every spending cap. [] removes all caps.

Itemsitems <= 10
recipient_restriction_enabled?boolean

When true, the agent can only pay users on its approved recipient list.

Response Body

OK

application/json
  1. response

A payout agent and its reserved balance, rules, and current spending cap usage.

id?string
Formatuuid
object?string
api_app_id?string

ID of the app the payout agent belongs to.

Formatuuid
name?string
status?string
  • active - the agent can send payouts
  • paused - new payouts are rejected with payout-agent-paused
Value in"active""paused"
paused_at?|

When the agent was paused. null while active.

Formatdate-time
created?string
Formatdate-time
currency?string
available_balance?integer

Funds, in cents, the agent can spend or the customer can reclaim.

committed_balance?integer

Principal, in cents, of the agent's payouts that have not reached a terminal status. It returns to available_balance if a payout fails, is canceled, or is reversed.

rules?
Example Request
curl -X PATCH 'https://api.dots.dev/api/v2/payout-agents/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{  "max_payout_amount": 10000,  "spending_caps": [    {      "amount": 20000,      "window_seconds": 3600    },    {      "amount": 100000,      "window_seconds": 86400    }  ]}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "object": "payout_agent",  "api_app_id": "ad6a2ad4-d593-4e3e-bfd5-50592ed119ca",  "name": "string",  "status": "active",  "paused_at": "2019-08-24T14:15:22Z",  "created": "2019-08-24T14:15:22Z",  "currency": "usd",  "available_balance": 0,  "committed_balance": 0,  "rules": {    "max_payout_amount": 0,    "recipient_restriction_enabled": true,    "spending_caps": [      {        "amount": 0,        "window_seconds": 0,        "used": 0,        "remaining": 0      }    ]  }}