customers.recent_returns
Recent returns for a customer
Last N returns (RMAs) for a customer, newest first, shaped as list items for the reviewer context panel.
readBetterCommerce
The tenant picks one of these when they bind this capability at install time. New implementations land as connectors ship — browse the connector catalogue.
Request arguments
Passed as the args parameter to ctx.capability.call("customers.recent_returns", …).
| Field | Type | Required | Description |
|---|---|---|---|
| string | no | Fallback lookup key when customerId is absent format: email | |
| limit | integer | no | default: 5 · min: 1 · max: 20 |
| customerId | string | no | The customer id from customers.lookup_by_email |
Response
Returned by ctx.capability.call("customers.recent_returns", …).
Array; each element is an object with the following fields.
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | yes | |
| title | string | yes | |
| badges | array<object> | no | |
| subtitle | string | null | no | Order number and reason for return |
| timestamp | string | null | no | format: date-time |
Example call
From inside your agent's handle(). The kernel resolves customers.recent_returns to the tenant's connector binding at invocation time.
response = await ctx.capability.call(
"customers.recent_returns",
args={
"email": "...",
"limit": 5,
"customerId": "...",
},
)See SDK quickstart for the full agent handler template; code examples covers invocation patterns including fanout and error handling.