Stripe · Arazzo Workflow

Stripe Subscribe Existing Customer

Version 1.0.0

Confirm a customer exists, then subscribe them to an existing price.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub CommerceFinancial ServicesFintechPaymentsT1ArazzoWorkflows

Provider

stripe

Workflows

subscribe-existing-customer
Verify a customer and subscribe them to an existing price.
Retrieves the customer to confirm it exists, then creates a Subscription binding that customer to the supplied price.
2 steps inputs: customer, price, quantity outputs: status, subscriptionId
1
getCustomer
getCustomersCustomer
Retrieve the customer to confirm it exists before subscribing.
2
createSubscription
PostSubscriptions
Subscribe the verified customer to the supplied price.

Source API Descriptions

Arazzo Workflow Specification

stripe-subscribe-existing-customer-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Stripe Subscribe Existing Customer
  summary: Confirm a customer exists, then subscribe them to an existing price.
  description: >-
    A lightweight subscription flow for catalogs that already have products and
    prices defined. The workflow retrieves the customer to confirm they exist,
    then opens a Subscription for them against a pre-existing price. Every step
    spells out its form-encoded request inline so the flow can be read and
    executed without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: customersApi
  url: ../openapi/stripe-customers-api-openapi.yml
  type: openapi
- name: subscriptionApi
  url: ../openapi/stripe-subscription-api-openapi.yml
  type: openapi
workflows:
- workflowId: subscribe-existing-customer
  summary: Verify a customer and subscribe them to an existing price.
  description: >-
    Retrieves the customer to confirm it exists, then creates a Subscription
    binding that customer to the supplied price.
  inputs:
    type: object
    required:
    - customer
    - price
    properties:
      customer:
        type: string
        description: ID of the existing customer to subscribe.
      price:
        type: string
        description: ID of the existing price to subscribe the customer to.
      quantity:
        type: integer
        description: Optional quantity for the subscription item.
  steps:
  - stepId: getCustomer
    description: Retrieve the customer to confirm it exists before subscribing.
    operationId: getCustomersCustomer
    parameters:
    - name: customer
      in: path
      value: $inputs.customer
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      customerId: $response.body#/id
  - stepId: createSubscription
    description: Subscribe the verified customer to the supplied price.
    operationId: PostSubscriptions
    requestBody:
      contentType: application/x-www-form-urlencoded
      payload:
        customer: $steps.getCustomer.outputs.customerId
        items:
        - price: $inputs.price
          quantity: $inputs.quantity
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      subscriptionId: $response.body#/id
      status: $response.body#/status
  outputs:
    subscriptionId: $steps.createSubscription.outputs.subscriptionId
    status: $steps.createSubscription.outputs.status