Paystack · Arazzo Workflow

Paystack Subscribe and Generate a Management Link

Version 1.0.0

Create a subscription, fetch it to read its status, then generate a self-service management link for the customer.

1 workflow 1 source API 1 provider
View Spec View on GitHub PaymentsAfricaFintechRecurring BillingMarketplacesPayoutsMobile MoneyStripeArazzoWorkflows

Provider

paystack

Workflows

subscribe-and-generate-manage-link
Create a subscription and hand the customer a self-service management link.
Creates a subscription, fetches it to confirm the status, and generates a management link the customer can use.
3 steps inputs: customer, plan, start_date outputs: manageLink, subscriptionCode, subscriptionStatus
1
createSubscription
subscription_create
Subscribe the customer to the plan.
2
fetchSubscription
subscription_fetch
Fetch the subscription to read back its current status.
3
generateManageLink
subscription_manageLink
Generate a self-service management link for the subscription.

Source API Descriptions

Arazzo Workflow Specification

paystack-subscribe-and-generate-manage-link-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Paystack Subscribe and Generate a Management Link
  summary: Create a subscription, fetch it to read its status, then generate a self-service management link for the customer.
  description: >-
    The subscription self-service flow. A subscription is created tying a customer
    to a plan, the subscription is fetched to read back its status and code, and a
    management link is generated so the customer can update their card or cancel
    without merchant intervention. Every step spells out its request inline so the
    flow can be read and executed without opening the underlying OpenAPI
    description.
  version: 1.0.0
sourceDescriptions:
- name: subscriptionsApi
  url: ../openapi/paystack-subscriptions-openapi.yml
  type: openapi
workflows:
- workflowId: subscribe-and-generate-manage-link
  summary: Create a subscription and hand the customer a self-service management link.
  description: >-
    Creates a subscription, fetches it to confirm the status, and generates a
    management link the customer can use.
  inputs:
    type: object
    required:
    - customer
    - plan
    properties:
      customer:
        type: string
        description: Customer's email address or customer code.
      plan:
        type: string
        description: Plan code to subscribe the customer to.
      start_date:
        type: string
        description: ISO 8601 date for the first debit.
  steps:
  - stepId: createSubscription
    description: Subscribe the customer to the plan.
    operationId: subscription_create
    requestBody:
      contentType: application/json
      payload:
        customer: $inputs.customer
        plan: $inputs.plan
        start_date: $inputs.start_date
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      subscriptionCode: $response.body#/data/subscription_code
  - stepId: fetchSubscription
    description: Fetch the subscription to read back its current status.
    operationId: subscription_fetch
    parameters:
    - name: code
      in: path
      value: $steps.createSubscription.outputs.subscriptionCode
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      subscriptionStatus: $response.body#/data/status
  - stepId: generateManageLink
    description: Generate a self-service management link for the subscription.
    operationId: subscription_manageLink
    parameters:
    - name: code
      in: path
      value: $steps.createSubscription.outputs.subscriptionCode
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      manageLink: $response.body#/data/link
  outputs:
    subscriptionCode: $steps.createSubscription.outputs.subscriptionCode
    subscriptionStatus: $steps.fetchSubscription.outputs.subscriptionStatus
    manageLink: $steps.generateManageLink.outputs.manageLink