Cross-Provider Workflow

Stripe Invoice Paid to SendGrid Receipt

Version 1.0.0

Pay a Stripe invoice, then email a paid receipt with SendGrid.

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

Providers Orchestrated

stripe sendgrid

Workflows

invoice-paid-receipt
Pay a Stripe invoice, then email a SendGrid receipt.
Pays an open invoice in Stripe and, on a paid status, emails the customer a receipt via SendGrid.
2 steps inputs: customerEmail, invoiceId outputs: invoiceId, invoicePaid, receiptStatus
1
pay-invoice
$sourceDescriptions.stripeApi.postInvoicesInvoicePay
Pay an open invoice in Stripe.
2
email-receipt
$sourceDescriptions.sendgridApi.SendMail
Email the customer a paid receipt via SendGrid Mail Send.

Source API Descriptions

Arazzo Workflow Specification

pay-stripe-invoice-paid-to-sendgrid-receipt-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Stripe Invoice Paid to SendGrid Receipt
  summary: Pay a Stripe invoice, then email a paid receipt with SendGrid.
  description: >-
    A cross-provider workflow that marks a Stripe invoice as paid and then emails
    the customer a paid-in-full receipt through SendGrid's Mail Send API. Useful for
    B2B billing flows where invoices are collected out of band and confirmation must
    follow automatically.
  version: 1.0.0
sourceDescriptions:
  - name: stripeApi
    url: https://raw.githubusercontent.com/api-evangelist/stripe/refs/heads/main/openapi/stripe-invoice-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: invoice-paid-receipt
    summary: Pay a Stripe invoice, then email a SendGrid receipt.
    description: >-
      Pays an open invoice in Stripe and, on a paid status, emails the customer a
      receipt via SendGrid.
    inputs:
      type: object
      properties:
        invoiceId:
          type: string
        customerEmail:
          type: string
    steps:
      - stepId: pay-invoice
        description: Pay an open invoice in Stripe.
        operationId: $sourceDescriptions.stripeApi.postInvoicesInvoicePay
        requestBody:
          contentType: application/x-www-form-urlencoded
          payload:
            invoice: $inputs.invoiceId
        successCriteria:
          - condition: $statusCode == 200
          - condition: $response.body#/paid == true
        outputs:
          invoiceId: $response.body#/id
          invoicePaid: $response.body#/paid
          amountPaid: $response.body#/amount_paid
      - stepId: email-receipt
        description: Email the customer a paid receipt via SendGrid Mail Send.
        operationId: $sourceDescriptions.sendgridApi.SendMail
        requestBody:
          contentType: application/json
          payload:
            personalizations:
              - to:
                  - email: $inputs.customerEmail
                subject: Your invoice is paid
            from:
              email: [email protected]
            content:
              - type: text/plain
                value: Invoice $steps.pay-invoice.outputs.invoiceId is paid in full. Thank you.
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          emailStatus: $statusCode
    outputs:
      invoiceId: $steps.pay-invoice.outputs.invoiceId
      invoicePaid: $steps.pay-invoice.outputs.invoicePaid
      receiptStatus: $steps.email-receipt.outputs.emailStatus