Capability catalogue
refundswrite
refunds.create
Create a refund
Issue a refund against an existing order. Not all connectors implement writes; check available() before calling.
Effect
write Fanout
no
Cache TTL
none
Traits
none
Request arguments
Passed as the args parameter to ctx.capability.call("refunds.create", …).
| Field | Type | Required | Description |
|---|---|---|---|
| amount | number | yes | |
| reason | string | yes | |
| orderId | string | yes | |
| currency | string | yes |
Response
Returned by ctx.capability.call("refunds.create", …).
| Field | Type | Required | Description |
|---|---|---|---|
| amount | number | no | |
| status | string | yes | enum: ["pending","succeeded","failed"] |
| currency | string | no | |
| refundId | string | yes |
Example call
From inside your agent's handle(). The kernel resolves refunds.create to the tenant's connector binding at invocation time.
response = await ctx.capability.call(
"refunds.create",
args={
"amount": 0,
"reason": "...",
"orderId": "...",
"currency": "...",
},
)See SDK quickstart for the full agent handler template; code examples covers invocation patterns including fanout and error handling.