Stripe · Arazzo Workflow

Stripe Expire Checkout Session

Version 1.0.0

Create a Checkout Session and then expire it to prevent further use.

1 workflow 1 source API 1 provider
View Spec View on GitHub CommerceFinancial ServicesFintechPaymentsT1ArazzoWorkflows

Provider

stripe

Workflows

expire-checkout-session
Create a Checkout Session and immediately expire it.
Creates a hosted Checkout Session for the supplied price, then expires the session so it can no longer be paid.
2 steps inputs: mode, price, quantity, successUrl outputs: sessionId, status
1
createSession
postCheckoutSessions
Create a hosted Checkout Session for the supplied price.
2
expireSession
postCheckoutSessionsSessionExpire
Expire the checkout session so it can no longer be completed.

Source API Descriptions

Arazzo Workflow Specification

stripe-expire-checkout-session-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Stripe Expire Checkout Session
  summary: Create a Checkout Session and then expire it to prevent further use.
  description: >-
    The cancel-a-checkout pattern for abandoned or superseded carts. The workflow
    creates a hosted Checkout Session for a price, then expires that session so it
    can no longer be completed. 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: checkoutApi
  url: ../openapi/stripe-checkout-api-openapi.yml
  type: openapi
workflows:
- workflowId: expire-checkout-session
  summary: Create a Checkout Session and immediately expire it.
  description: >-
    Creates a hosted Checkout Session for the supplied price, then expires the
    session so it can no longer be paid.
  inputs:
    type: object
    required:
    - price
    - successUrl
    properties:
      price:
        type: string
        description: ID of the price to sell through checkout.
      quantity:
        type: integer
        description: Quantity of the line item (defaults to 1 if omitted).
      mode:
        type: string
        description: Checkout mode (payment, subscription, or setup).
      successUrl:
        type: string
        description: URL to redirect to after a successful checkout.
  steps:
  - stepId: createSession
    description: Create a hosted Checkout Session for the supplied price.
    operationId: postCheckoutSessions
    requestBody:
      contentType: application/x-www-form-urlencoded
      payload:
        mode: $inputs.mode
        success_url: $inputs.successUrl
        line_items:
        - price: $inputs.price
          quantity: $inputs.quantity
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      sessionId: $response.body#/id
  - stepId: expireSession
    description: Expire the checkout session so it can no longer be completed.
    operationId: postCheckoutSessionsSessionExpire
    parameters:
    - name: session
      in: path
      value: $steps.createSession.outputs.sessionId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      status: $response.body#/status
  outputs:
    sessionId: $steps.createSession.outputs.sessionId
    status: $steps.expireSession.outputs.status