Cross-Provider Workflow

Stripe Payment to SendGrid Receipt

Version 1.0.0

Charge a customer with Stripe, then email them a receipt with SendGrid.

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

Providers Orchestrated

stripe sendgrid

Workflows

charge-and-email-receipt
Create a Stripe payment, then email a SendGrid receipt on success.
Creates and confirms a PaymentIntent in Stripe, branches on the returned status, and on a succeeded charge sends a receipt email via SendGrid.
2 steps inputs: amount, currency, customerEmail, paymentMethod outputs: chargeStatus, paymentId, receiptStatus
1
create-payment
$sourceDescriptions.stripeApi.postPaymentIntents
Create and confirm a PaymentIntent for the customer's order.
2
email-receipt
$sourceDescriptions.sendgridApi.SendMail
Send a receipt email to the customer via SendGrid Mail Send.

Source API Descriptions

Arazzo Workflow Specification

stripe-payment-to-sendgrid-receipt-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Stripe Payment to SendGrid Receipt
  summary: Charge a customer with Stripe, then email them a receipt with SendGrid.
  description: >-
    A cross-provider workflow that takes a payment through Stripe's PaymentIntents
    API and, on success, sends a branded receipt email to the customer through
    SendGrid's Mail Send API. Demonstrates orchestrating a payment provider and a
    communications provider in a single Arazzo workflow.
  version: 1.0.0
sourceDescriptions:
  - name: stripeApi
    url: https://raw.githubusercontent.com/api-evangelist/stripe/refs/heads/main/openapi/stripe-payment-intents-api-openapi.yml
    type: openapi
  - name: sendgridApi
    url: https://raw.githubusercontent.com/api-evangelist/sendgrid/refs/heads/main/openapi/tsg_mail_v3.yaml
    type: openapi
workflows:
  - workflowId: charge-and-email-receipt
    summary: Create a Stripe payment, then email a SendGrid receipt on success.
    description: >-
      Creates and confirms a PaymentIntent in Stripe, branches on the returned
      status, and on a succeeded charge sends a receipt email via SendGrid.
    inputs:
      type: object
      properties:
        amount:
          type: integer
        currency:
          type: string
        customerEmail:
          type: string
        paymentMethod:
          type: string
    steps:
      - stepId: create-payment
        description: Create and confirm a PaymentIntent for the customer's order.
        operationId: $sourceDescriptions.stripeApi.postPaymentIntents
        requestBody:
          contentType: application/x-www-form-urlencoded
          payload:
            amount: $inputs.amount
            currency: $inputs.currency
            confirm: true
            payment_method: $inputs.paymentMethod
        successCriteria:
          - condition: $statusCode == 200
          - condition: $response.body#/status == "succeeded"
        outputs:
          paymentId: $response.body#/id
          chargeStatus: $response.body#/status
          amountReceived: $response.body#/amount_received
      - stepId: email-receipt
        description: Send a receipt email to the customer via SendGrid Mail Send.
        operationId: $sourceDescriptions.sendgridApi.SendMail
        requestBody:
          contentType: application/json
          payload:
            personalizations:
              - to:
                  - email: $inputs.customerEmail
                subject: Your receipt
            from:
              email: [email protected]
            content:
              - type: text/plain
                value: Thank you for your payment.
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          messageStatus: $statusCode
    outputs:
      paymentId: $steps.create-payment.outputs.paymentId
      chargeStatus: $steps.create-payment.outputs.chargeStatus
      receiptStatus: $steps.email-receipt.outputs.messageStatus