stripe.refunds.create_refund ​
Issue a refund for a Stripe charge or PaymentIntent
Issue a refund for a Stripe charge or PaymentIntent.
Acts on the CUSTOMER'S OWN Stripe account, authenticated via the org-scoped Stripe connection selected by cloud_connection_uuid.
Supply either charge_id or payment_intent_id. If amount is omitted the full charge is refunded.
Inputs:
- cloud_connection_uuid: Org-scoped Stripe connection UUID (required).
- charge_id: Stripe charge ID to refund (optional, e.g. ch_ABC123).
- payment_intent_id: PaymentIntent ID to refund (optional, e.g. pi_ABC123).
- amount: Amount to refund in smallest currency unit (optional, default: full refund).
- reason: duplicate | fraudulent | requested_by_customer (optional).
- metadata: Arbitrary key-value metadata (optional).
Outputs (terminal state_data):
- refund_id: str — Stripe refund ID (re_...)
- amount: int — refunded amount in smallest currency unit
- status: str — pending | succeeded | failed | cancelled
- currency: str
Connection required: cloud_connection_uuid — the organization's own Stripe account credentials; there is no platform-key fallback.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-stripe |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
cloud_connection_uuid | uuid | Yes | — | Org-scoped Stripe connection (customer's own account) |
charge_id | string | No | — | Stripe charge ID, e.g. ch_ABC123 |
payment_intent_id | string | No | — | Stripe PaymentIntent ID, e.g. pi_ABC123 |
amount | integer | No | — | Amount in smallest currency unit (default: full refund) |
reason | string | No | — | duplicate |
metadata | json | No | — | Arbitrary key-value metadata |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
amount | integer | No | — | — |
currency | string | No | — | — |
refund_id | string | No | — | — |
status | string | No | — | — |
cloud_connection_uuid | uuid | No | — | — |
charge_id | string | No | — | — |
metadata | json | No | — | — |
payment_intent_id | string | No | — | — |
reason | string | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "stripe.refunds.create_refund",
"initial_data": {
"cloud_connection_uuid": "value"
}
}