Cross-Provider Workflow

Stripe Charge to Twilio SMS Receipt

Version 1.0.0

Create a Stripe charge, then text the customer an SMS receipt with Twilio.

1 workflow 2 source APIs 2 providers
View Spec View on GitHub ArazzoWorkflowsCross-Provider

Providers Orchestrated

stripe twilio

Workflows

charge-and-sms-receipt
Create a Stripe charge, then SMS a Twilio receipt on success.
Creates a charge in Stripe, branches on the returned status, and on a succeeded charge sends a receipt SMS via Twilio's Messaging API.
2 steps inputs: accountSid, amount, currency, fromNumber, source, toNumber outputs: chargeId, chargeStatus, messageSid
1
create-charge
$sourceDescriptions.stripeApi.postCharges
Create a charge for the customer's order in Stripe.
2
sms-receipt
$sourceDescriptions.twilioApi.createMessage
Send the customer an SMS receipt via Twilio Messaging.

Source API Descriptions

Arazzo Workflow Specification

pay-stripe-charge-to-twilio-sms-receipt-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Stripe Charge to Twilio SMS Receipt
  summary: Create a Stripe charge, then text the customer an SMS receipt with Twilio.
  description: >-
    A cross-provider workflow that captures a payment through Stripe's Charges API
    and, on a successful charge, sends the customer a confirmation receipt over SMS
    using Twilio's Messaging API. Pairs a payment provider with a communications
    provider to close the loop on a mobile-first checkout.
  version: 1.0.0
sourceDescriptions:
  - name: stripeApi
    url: https://raw.githubusercontent.com/api-evangelist/stripe/refs/heads/main/openapi/stripe-charges-api-openapi.yml
    type: openapi
  - name: twilioApi
    url: https://raw.githubusercontent.com/api-evangelist/twilio/refs/heads/main/openapi/twilio-messaging-openapi.yml
    type: openapi
workflows:
  - workflowId: charge-and-sms-receipt
    summary: Create a Stripe charge, then SMS a Twilio receipt on success.
    description: >-
      Creates a charge in Stripe, branches on the returned status, and on a
      succeeded charge sends a receipt SMS via Twilio's Messaging API.
    inputs:
      type: object
      properties:
        amount:
          type: integer
        currency:
          type: string
        source:
          type: string
        accountSid:
          type: string
        fromNumber:
          type: string
        toNumber:
          type: string
    steps:
      - stepId: create-charge
        description: Create a charge for the customer's order in Stripe.
        operationId: $sourceDescriptions.stripeApi.postCharges
        requestBody:
          contentType: application/x-www-form-urlencoded
          payload:
            amount: $inputs.amount
            currency: $inputs.currency
            source: $inputs.source
        successCriteria:
          - condition: $statusCode == 200
          - condition: $response.body#/status == "succeeded"
        outputs:
          chargeId: $response.body#/id
          chargeStatus: $response.body#/status
          amountCharged: $response.body#/amount
      - stepId: sms-receipt
        description: Send the customer an SMS receipt via Twilio Messaging.
        operationId: $sourceDescriptions.twilioApi.createMessage
        requestBody:
          contentType: application/x-www-form-urlencoded
          payload:
            AccountSid: $inputs.accountSid
            From: $inputs.fromNumber
            To: $inputs.toNumber
            Body: Payment received. Charge $steps.create-charge.outputs.chargeId confirmed.
        successCriteria:
          - condition: $statusCode == 201
        outputs:
          messageSid: $response.body#/sid
          messageStatus: $response.body#/status
    outputs:
      chargeId: $steps.create-charge.outputs.chargeId
      chargeStatus: $steps.create-charge.outputs.chargeStatus
      messageSid: $steps.sms-receipt.outputs.messageSid