Cross-Provider Workflow

Square Sale to Twilio SMS Confirmation

Version 1.0.0

Take a Square payment with Block, then text the buyer via Twilio.

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

Providers Orchestrated

block twilio

Workflows

square-sale-sms
Create a Square payment, then SMS a Twilio confirmation.
Creates a payment with Block's Square Payments API and, on a completed sale, texts the buyer a confirmation via Twilio Messaging.
2 steps inputs: accountSid, amount, currency, fromNumber, idempotencyKey, sourceId, toNumber outputs: messageSid, paymentId, paymentStatus
1
create-payment
$sourceDescriptions.blockApi.create-payment
Create a payment with Block's Square Payments API.
2
sms-confirmation
$sourceDescriptions.twilioApi.createMessage
Text the buyer a confirmation via Twilio Messaging.

Source API Descriptions

Arazzo Workflow Specification

pay-block-sale-to-twilio-sms-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Square Sale to Twilio SMS Confirmation
  summary: Take a Square payment with Block, then text the buyer via Twilio.
  description: >-
    A cross-provider workflow that captures a sale through Block's Square Payments
    API and, on a completed payment, sends the buyer an SMS confirmation through
    Twilio's Messaging API. Ideal for mobile checkout and counter sales where a text
    receipt is faster than email.
  version: 1.0.0
sourceDescriptions:
  - name: blockApi
    url: https://raw.githubusercontent.com/api-evangelist/block/refs/heads/main/openapi/block-square-api-openapi.yaml
    type: openapi
  - name: twilioApi
    url: https://raw.githubusercontent.com/api-evangelist/twilio/refs/heads/main/openapi/twilio-messaging-openapi.yml
    type: openapi
workflows:
  - workflowId: square-sale-sms
    summary: Create a Square payment, then SMS a Twilio confirmation.
    description: >-
      Creates a payment with Block's Square Payments API and, on a completed sale,
      texts the buyer a confirmation via Twilio Messaging.
    inputs:
      type: object
      properties:
        sourceId:
          type: string
        idempotencyKey:
          type: string
        amount:
          type: integer
        currency:
          type: string
        accountSid:
          type: string
        fromNumber:
          type: string
        toNumber:
          type: string
    steps:
      - stepId: create-payment
        description: Create a payment with Block's Square Payments API.
        operationId: $sourceDescriptions.blockApi.create-payment
        requestBody:
          contentType: application/json
          payload:
            source_id: $inputs.sourceId
            idempotency_key: $inputs.idempotencyKey
            amount_money:
              amount: $inputs.amount
              currency: $inputs.currency
        successCriteria:
          - condition: $statusCode == 200
          - condition: $response.body#/payment/status == "COMPLETED"
        outputs:
          paymentId: $response.body#/payment/id
          paymentStatus: $response.body#/payment/status
      - stepId: sms-confirmation
        description: Text the buyer a confirmation 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: Your Square payment $steps.create-payment.outputs.paymentId is complete.
        successCriteria:
          - condition: $statusCode == 201
        outputs:
          messageSid: $response.body#/sid
          messageStatus: $response.body#/status
    outputs:
      paymentId: $steps.create-payment.outputs.paymentId
      paymentStatus: $steps.create-payment.outputs.paymentStatus
      messageSid: $steps.sms-confirmation.outputs.messageSid