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
x-realizes-capability-ids:
- BC-4240
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-4240
capability_name: Subscription Lifecycle Management
spec: paystack-subscription-api-openapi.yml
confidence: 0.75
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: subscriptionApi
url: ../openapi/paystack-subscription-api-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
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.