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 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