arazzo: 1.0.1
info:
title: Stripe Capture and Partial Refund
summary: Create an uncaptured charge, capture it, then partially refund the captured amount.
description: >-
A delayed-capture charge pattern that also reverses part of the collected
funds. The workflow creates a Charge with capture disabled, captures it to
settle the funds, then issues a partial Refund against the captured charge.
Every step spells out its form-encoded request inline so the flow can be read
and executed without opening the underlying OpenAPI description.
version: 1.0.0
x-realizes-capability-ids:
- BC-1340.70
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-1340.70
capability_name: Card Transaction Processing Management
spec: stripe-charges-api-openapi.yml
confidence: 0.8
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: chargesApi
url: ../openapi/stripe-charges-api-openapi.yml
type: openapi
workflows:
- workflowId: capture-and-partial-refund
summary: Authorize a charge, capture it, then partially refund it.
description: >-
Creates a Charge with capture set to false to authorize only, captures the
charge to settle funds, then refunds part of the captured amount.
inputs:
type: object
required:
- amount
- currency
- source
- refundAmount
properties:
amount:
type: integer
description: Authorization amount in the smallest currency unit.
currency:
type: string
description: Three-letter ISO currency code.
source:
type: string
description: A payment source or token to charge (e.g. tok_visa).
refundAmount:
type: integer
description: Amount to refund after capture, in the smallest currency unit.
steps:
- stepId: authorizeCharge
description: Create a charge with capture disabled to authorize only.
operationId: PostCharges
requestBody:
contentType: application/x-www-form-urlencoded
payload:
amount: $inputs.amount
currency: $inputs.currency
source: $inputs.source
capture: false
successCriteria:
- condition: $statusCode == 200
outputs:
chargeId: $response.body#/id
- stepId: captureCharge
description: Capture the previously authorized charge to settle the funds.
operationId: PostChargesChargeCapture
parameters:
- name: charge
in: path
value: $steps.authorizeCharge.outputs.chargeId
successCriteria:
- condition: $statusCode == 200
outputs:
captured: $response.body#/captured
- stepId: partialRefund
description: Refund part of the captured charge.
operationId: PostChargesChargeRefunds
parameters:
- name: charge
in: path
value: $steps.authorizeCharge.outputs.chargeId
requestBody:
contentType: application/x-www-form-urlencoded
payload:
amount: $inputs.refundAmount
successCriteria:
- condition: $statusCode == 200
outputs:
refundId: $response.body#/id
refundStatus: $response.body#/status
outputs:
chargeId: $steps.authorizeCharge.outputs.chargeId
refundId: $steps.partialRefund.outputs.refundId
refundStatus: $steps.partialRefund.outputs.refundStatus
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.