Cross-Provider Workflow

Shopify Order to Stripe Payment to SendGrid Receipt

Version 1.0.0

Create a Shopify order, charge the customer with Stripe, then email a receipt with SendGrid.

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

Providers Orchestrated

shopify stripe sendgrid

Workflows

order-charge-and-email-receipt
Record a Shopify order, charge it via Stripe, and email a SendGrid receipt.
Creates a Shopify order to represent a sale from an external channel, charges the customer for the order total with a confirmed Stripe PaymentIntent, then emails a receipt to the customer with SendGrid.
3 steps inputs: amount, currency, customerEmail, lineItemPrice, lineItemTitle, paymentMethod outputs: orderId, paymentId, receiptStatus
1
create-order
$sourceDescriptions.shopifyApi.createOrder
Create a Shopify order for the customer's purchase.
2
create-payment
$sourceDescriptions.stripeApi.postPaymentIntents
Create and confirm a Stripe PaymentIntent for the order total.
3
email-receipt
$sourceDescriptions.sendgridApi.SendMail
Email the customer a receipt for the paid order via SendGrid.

Source API Descriptions

Arazzo Workflow Specification

shop-order-payment-receipt-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Shopify Order to Stripe Payment to SendGrid Receipt
  summary: Create a Shopify order, charge the customer with Stripe, then email a receipt with SendGrid.
  description: >-
    An end-to-end e-commerce checkout workflow that records a sale as a Shopify
    order, collects payment for it through a Stripe PaymentIntent, and on a
    successful charge sends the customer a branded receipt email through
    SendGrid. Demonstrates orchestrating a commerce platform, a payment
    provider, and a communications provider in a single Arazzo workflow.
  version: 1.0.0
sourceDescriptions:
  - name: shopifyApi
    url: https://raw.githubusercontent.com/api-evangelist/shopify/refs/heads/main/openapi/shopify-admin-rest-api-openapi.yml
    type: openapi
  - 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: order-charge-and-email-receipt
    summary: Record a Shopify order, charge it via Stripe, and email a SendGrid receipt.
    description: >-
      Creates a Shopify order to represent a sale from an external channel,
      charges the customer for the order total with a confirmed Stripe
      PaymentIntent, then emails a receipt to the customer with SendGrid.
    inputs:
      type: object
      properties:
        customerEmail:
          type: string
        lineItemTitle:
          type: string
        lineItemPrice:
          type: string
        amount:
          type: integer
        currency:
          type: string
        paymentMethod:
          type: string
    steps:
      - stepId: create-order
        description: Create a Shopify order for the customer's purchase.
        operationId: $sourceDescriptions.shopifyApi.createOrder
        requestBody:
          contentType: application/json
          payload:
            order:
              email: $inputs.customerEmail
              line_items:
                - title: $inputs.lineItemTitle
                  price: $inputs.lineItemPrice
                  quantity: 1
        successCriteria:
          - condition: $statusCode == 201
        outputs:
          orderId: $response.body#/order/id
          orderName: $response.body#/order/name
      - stepId: create-payment
        description: Create and confirm a Stripe PaymentIntent for the order total.
        operationId: $sourceDescriptions.stripeApi.postPaymentIntents
        requestBody:
          contentType: application/x-www-form-urlencoded
          payload:
            amount: $inputs.amount
            currency: $inputs.currency
            confirm: true
            payment_method: $inputs.paymentMethod
            description: $steps.create-order.outputs.orderName
        successCriteria:
          - condition: $statusCode == 200
          - condition: $response.body#/status == "succeeded"
        outputs:
          paymentId: $response.body#/id
          chargeStatus: $response.body#/status
      - stepId: email-receipt
        description: Email the customer a receipt for the paid order via SendGrid.
        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 order. Your payment was received.
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          receiptStatus: $statusCode
    outputs:
      orderId: $steps.create-order.outputs.orderId
      paymentId: $steps.create-payment.outputs.paymentId
      receiptStatus: $steps.email-receipt.outputs.receiptStatus