Paystack · Arazzo Workflow

Paystack Charge and Refund a Transaction

Version 1.0.0

Initialize and verify a transaction, then create a refund against it and fetch the refund status.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub PaymentsAfricaFintechRecurring BillingMarketplacesPayoutsMobile MoneyStripeArazzoWorkflows

Provider

paystack

Workflows

charge-and-refund-transaction
Collect a payment, then issue and track a refund against it.
Initializes and verifies a transaction, creates a refund against the reference, and fetches the refund record to confirm its status.
4 steps inputs: amount, customer_note, email, refundAmount outputs: reference, refundId, refundStatus
1
initializeTransaction
Initialize the transaction that will later be refunded.
2
verifyTransaction
Verify the transaction reached a final state before refunding.
3
createRefund
Create a refund against the verified transaction reference.
4
fetchRefund
Fetch the refund record to confirm its current processing status.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Paystack Charge and Refund a Transaction
  summary: Initialize and verify a transaction, then create a refund against it and fetch the refund status.
  description: >-
    A pay-then-refund lifecycle. A transaction is initialized and verified to a
    successful state, a refund is created against the verified reference, and the
    refund record is fetched to confirm its processing status. 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: refundApi
  url: ../openapi/paystack-refund-api-openapi.yml
  type: openapi
- name: transactionApi
  url: ../openapi/paystack-transaction-api-openapi.yml
  type: openapi
workflows:
- workflowId: charge-and-refund-transaction
  summary: Collect a payment, then issue and track a refund against it.
  description: >-
    Initializes and verifies a transaction, creates a refund against the
    reference, and fetches the refund record to confirm its status.
  inputs:
    type: object
    required:
    - email
    - amount
    properties:
      email:
        type: string
        description: Customer's email address.
      amount:
        type: integer
        description: Transaction amount in the smallest currency unit.
      refundAmount:
        type: integer
        description: Amount to refund; omit to refund the full transaction amount.
      customer_note:
        type: string
        description: Reason for the refund shown to the customer.
  steps:
  - stepId: initializeTransaction
    description: Initialize the transaction that will later be refunded.
    operationId: transaction_initialize
    requestBody:
      contentType: application/json
      payload:
        email: $inputs.email
        amount: $inputs.amount
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      reference: $response.body#/data/reference
  - stepId: verifyTransaction
    description: Verify the transaction reached a final state before refunding.
    operationId: transaction_verify
    parameters:
    - name: reference
      in: path
      value: $steps.initializeTransaction.outputs.reference
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      status: $response.body#/data/status
  - stepId: createRefund
    description: Create a refund against the verified transaction reference.
    operationId: refund_create
    requestBody:
      contentType: application/json
      payload:
        transaction: $steps.initializeTransaction.outputs.reference
        amount: $inputs.refundAmount
        customer_note: $inputs.customer_note
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      refundId: $response.body#/data/id
      refundStatus: $response.body#/data/status
  - stepId: fetchRefund
    description: Fetch the refund record to confirm its current processing status.
    operationId: refund_fetch
    parameters:
    - name: id
      in: path
      value: $steps.createRefund.outputs.refundId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      refundStatus: $response.body#/data/status
  outputs:
    reference: $steps.initializeTransaction.outputs.reference
    refundId: $steps.createRefund.outputs.refundId
    refundStatus: $steps.fetchRefund.outputs.refundStatus

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/paystack-charge-and-refund-transaction-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

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.

A second provider on the same verified email joins the account you already have.