Cross-Provider Workflow

Stripe Credit Note to SendGrid Notification

Version 1.0.0

Issue a Stripe credit note, then email the customer a refund notice via SendGrid.

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

Providers Orchestrated

stripe sendgrid

Workflows

credit-note-and-notify
Issue a Stripe credit note, then email the customer a refund notice.
Creates a Stripe credit note against an invoice and emails the customer a credit notification via SendGrid.
2 steps inputs: creditAmount, customerEmail, fromEmail, invoiceId outputs: creditNoteId, emailStatus
1
create-credit-note
$sourceDescriptions.stripeCreditNotesApi.postCreditNotes
Issue a Stripe credit note against the invoice.
2
email-customer
$sourceDescriptions.sendgridApi.SendMail
Email the customer a credit notice via SendGrid.

Source API Descriptions

Arazzo Workflow Specification

fin-stripe-credit-note-to-sendgrid.yml Raw ↑
arazzo: 1.0.1
info:
  title: Stripe Credit Note to SendGrid Notification
  summary: Issue a Stripe credit note, then email the customer a refund notice via SendGrid.
  description: >-
    A refund-communication workflow that issues a credit note against a Stripe
    invoice and emails the customer a refund or adjustment notice through
    SendGrid. Demonstrates pairing a billing-adjustment action with an email
    communications provider to keep customers informed of credits.
  version: 1.0.0
sourceDescriptions:
  - name: stripeCreditNotesApi
    url: https://raw.githubusercontent.com/api-evangelist/stripe/refs/heads/main/openapi/stripe-credit-notes-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: credit-note-and-notify
    summary: Issue a Stripe credit note, then email the customer a refund notice.
    description: >-
      Creates a Stripe credit note against an invoice and emails the customer a
      credit notification via SendGrid.
    inputs:
      type: object
      properties:
        invoiceId:
          type: string
        creditAmount:
          type: integer
        customerEmail:
          type: string
        fromEmail:
          type: string
    steps:
      - stepId: create-credit-note
        description: Issue a Stripe credit note against the invoice.
        operationId: $sourceDescriptions.stripeCreditNotesApi.postCreditNotes
        requestBody:
          contentType: application/x-www-form-urlencoded
          payload:
            invoice: $inputs.invoiceId
            amount: $inputs.creditAmount
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          creditNoteId: $response.body#/id
          creditNoteStatus: $response.body#/status
      - stepId: email-customer
        description: Email the customer a credit notice via SendGrid.
        operationId: $sourceDescriptions.sendgridApi.SendMail
        requestBody:
          contentType: application/json
          payload:
            personalizations:
              - to:
                  - email: $inputs.customerEmail
                subject: A credit has been applied to your account
            from:
              email: $inputs.fromEmail
            content:
              - type: text/plain
                value: A credit note has been issued against your invoice.
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          emailStatus: $statusCode
    outputs:
      creditNoteId: $steps.create-credit-note.outputs.creditNoteId
      emailStatus: $steps.email-customer.outputs.emailStatus