roarexclamation/paystack-php-sdk

PHP SDK for Paystack API

v1.0.0 2025-05-12 18:07 UTC

This package is auto-updated.

Last update: 2025-05-12 18:20:39 UTC


README

The OpenAPI specification of the Paystack API that merchants and developers can harness to build financial solutions in Africa.

Installation & Usage

Requirements

PHP 8.1 and later.

Composer

To install the bindings via Composer, add the following to composer.json:

composer require roar-exclamation/paysatck-php-sdk

Then run composer install

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\ApplePayApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$use_cursor = True; // bool
$next = 'next_example'; // string
$previous = 'previous_example'; // string

try {
    $result = $apiInstance->applePayListDomain($use_cursor, $next, $previous);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ApplePayApi->applePayListDomain: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://api.paystack.co

Class Method HTTP request Description
ApplePayApi applePayListDomain GET /apple-pay/domain List Domains
ApplePayApi applePayRegisterDomain POST /apple-pay/domain Register Domain
ApplePayApi applePayUnregisterDomain DELETE /apple-pay/domain Unregister Domain
BalanceApi balanceFetch GET /balance Fetch Balance
BalanceApi balanceLedger GET /balance/ledger Balance Ledger
BankApi bankList GET /bank List Banks
BankApi bankResolveAccountNumber GET /bank/resolve Resolve Account Number
BankApi bankValidateAccountNumber POST /bank/validate Validate Bank Account
BulkChargeApi bulkChargeCharges GET /bulkcharge/{code}/charges Fetch Charges in a Batch
BulkChargeApi bulkChargeFetch GET /bulkcharge/{code} Fetch Bulk Charge Batch
BulkChargeApi bulkChargeInitiate POST /bulkcharge Initiate Bulk Charge
BulkChargeApi bulkChargeList GET /bulkcharge List Bulk Charge Batches
BulkChargeApi bulkChargePause GET /bulkcharge/pause/{code} Pause Bulk Charge Batch
BulkChargeApi bulkChargeResume GET /bulkcharge/resume/{code} Resume Bulk Charge Batch
ChargeApi chargeCheck GET /charge/{reference} Check pending charge
ChargeApi chargeCreate POST /charge Create Charge
ChargeApi chargeSubmitAddress POST /charge/submit_address Submit Address
ChargeApi chargeSubmitBirthday POST /charge/submit_birthday Submit Birthday
ChargeApi chargeSubmitOtp POST /charge/submit_otp Submit OTP
ChargeApi chargeSubmitPhone POST /charge/submit_phone Submit Phone
ChargeApi chargeSubmitPin POST /charge/submit_pin Submit PIN
CustomerApi customerCreate POST /customer Create Customer
CustomerApi customerDeactivateAuthorization POST /customer/deactivate_authorization Deactivate Authorization
CustomerApi customerFetch GET /customer/{code} Fetch Customer
CustomerApi customerList GET /customer List Customers
CustomerApi customerRiskAction POST /customer/set_risk_action White/blacklist Customer
CustomerApi customerUpdate PUT /customer/{code} Update Customer
CustomerApi customerValidate POST /customer/{code}/identification Validate Customer
DedicatedVirtualAccountApi dedicatedAccountAddSplit POST /dedicated_account/split Split Dedicated Account Transaction
DedicatedVirtualAccountApi dedicatedAccountAssign POST /dedicated_account/assign Assign Dedicated Account
DedicatedVirtualAccountApi dedicatedAccountAvailableProviders GET /dedicated_account/available_providers Fetch Bank Providers
DedicatedVirtualAccountApi dedicatedAccountCreate POST /dedicated_account Create Dedicated Account
DedicatedVirtualAccountApi dedicatedAccountDeactivate DELETE /dedicated_account/{account_id} Deactivate Dedicated Account
DedicatedVirtualAccountApi dedicatedAccountFetch GET /dedicated_account/{account_id} Fetch Dedicated Account
DedicatedVirtualAccountApi dedicatedAccountList GET /dedicated_account List Dedicated Accounts
DedicatedVirtualAccountApi dedicatedAccountRemoveSplit DELETE /dedicated_account/split Remove Split from Dedicated Account
DedicatedVirtualAccountApi dedicatedAccountRequery GET /dedicated_account/requery Requery Dedicated Account
DisputeApi disputeDownload GET /dispute/export Export Disputes
DisputeApi disputeEvidence POST /dispute/{id}/evidence Add Evidence
DisputeApi disputeFetch GET /dispute/{id} Fetch Dispute
DisputeApi disputeList GET /dispute List Disputes
DisputeApi disputeResolve PUT /dispute/{id}/resolve Resolve a Dispute
DisputeApi disputeTransaction GET /dispute/transaction/{id} List Transaction Disputes
DisputeApi disputeUpdate PUT /dispute/{id} Update Dispute
DisputeApi disputeUploadUrl GET /dispute/{id}/upload_url Get Upload URL
IntegrationApi integrationFetchPaymentSessionTimeout GET /integration/payment_session_timeout Fetch Payment Session Timeout
IntegrationApi integrationUpdatePaymentSessionTimeout PUT /integration/payment_session_timeout Update Payment Session Timeout
MiscellaneousApi miscellaneousAvs GET /address_verification/states List States (AVS)
MiscellaneousApi miscellaneousListCountries GET /country List Countries
MiscellaneousApi miscellaneousResolveCardBin GET /decision/bin/{bin} Resolve Card BIN
OrderApi orderCreate POST /order Create Order
OrderApi orderFetch GET /order/{id} Fetch Order
OrderApi orderFetchProducts GET /order/product/{id} Fetch Products Order
OrderApi orderList GET /order List Orders
OrderApi orderValidatePayForMe GET /order/{code}/validate Validate pay for me order
PageApi pageAddProducts POST /page/{id}/product Add Products
PageApi pageCheckSlugAvailability GET /page/check_slug_availability/{slug} Check Slug Availability
PageApi pageCreate POST /page Create Page
PageApi pageFetch GET /page/{id} Fetch Page
PageApi pageList GET /page List Pages
PageApi pageUpdate PUT /page/{id} Update Page
PaymentRequestApi paymentRequestArchive POST /paymentrequest/archive/{id} Archive Payment Request
PaymentRequestApi paymentRequestCreate POST /paymentrequest Create Payment Request
PaymentRequestApi paymentRequestFetch GET /paymentrequest/{id} Fetch Payment Request
PaymentRequestApi paymentRequestFinalize POST /paymentrequest/finalize/{id} Finalize Payment Request
PaymentRequestApi paymentRequestList GET /paymentrequest List Payment Request
PaymentRequestApi paymentRequestNotify POST /paymentrequest/notify/{id} Send Notification
PaymentRequestApi paymentRequestTotals GET /paymentrequest/totals Payment Request Total
PaymentRequestApi paymentRequestUpdate PUT /paymentrequest/{id} Update Payment Request
PaymentRequestApi paymentRequestVerify GET /paymentrequest/verify/{id} Verify Payment Request
PlanApi planCreate POST /plan Create Plan
PlanApi planFetch GET /plan/{code} Fetch Plan
PlanApi planList GET /plan List Plans
PlanApi planUpdate PUT /plan/{code} Update Plan
ProductApi productCreate POST /product Create Product
ProductApi productDelete DELETE /product/{id} Delete Product
ProductApi productFetch GET /product/{id} Fetch Product
ProductApi productList GET /product List Products
ProductApi productUpdate PUT /product/{id} Update product
RefundApi refundCreate POST /refund Create Refund
RefundApi refundFetch GET /refund/{id} Fetch Refund
RefundApi refundList GET /refund List Refunds
SettlementApi settlementsFetch GET /settlement Fetch Settlements
SettlementApi settlementsTransaction GET /settlement/{id}/transaction Settlement Transactions
SplitApi splitAddSubaccount POST /split/{id}/subaccount/add Add Subaccount to Split
SplitApi splitCreate POST /split Create Split
SplitApi splitFetch GET /split/{id} Fetch Split
SplitApi splitList GET /split List/Search Splits
SplitApi splitRemoveSubaccount POST /split/{id}/subaccount/remove Remove Subaccount from split
SplitApi splitUpdate PUT /split/{id} Update Split
StorefrontApi storefrontAddProducts POST /storefront/{id}/product Add Products to Storefront
StorefrontApi storefrontCreate POST /storefront Create Storefront
StorefrontApi storefrontDelete DELETE /storefront/{id} Delete Storefront
StorefrontApi storefrontDuplicate POST /storefront/{id}/duplicate Duplicate Storefront
StorefrontApi storefrontFetch GET /storefront/{id} Fetch Storefront
StorefrontApi storefrontFetchOrders GET /storefront/{id}/order Fetch Storefront Orders
StorefrontApi storefrontList GET /storefront List Storefronts
StorefrontApi storefrontListProducts GET /storefront/{id}/product List Products in Storefront
StorefrontApi storefrontPublish POST /storefront/{id}/publish Publish Storefront
StorefrontApi storefrontUpdate PUT /storefront/{id} Update Storefront
StorefrontApi storefrontVerifySlug GET /storefront/verify/{slug} Verify Storefront Slug
SubaccountApi subaccountCreate POST /subaccount Create Subaccount
SubaccountApi subaccountFetch GET /subaccount/{code} Fetch Subaccount
SubaccountApi subaccountList GET /subaccount List Subaccounts
SubaccountApi subaccountUpdate PUT /subaccount/{code} Update Subaccount
SubscriptionApi subscriptionCreate POST /subscription Create Subscription
SubscriptionApi subscriptionDisable POST /subscription/disable Disable Subscription
SubscriptionApi subscriptionEnable POST /subscription/enable Enable Subscription
SubscriptionApi subscriptionFetch GET /subscription/{code} Fetch Subscription
SubscriptionApi subscriptionList GET /subscription List Subscriptions
SubscriptionApi subscriptionManageEmail POST /subscription/{code}/manage/email Send Update Subscription Link
SubscriptionApi subscriptionManageLink GET /subscription/{code}/manage/link Generate Update Subscription Link
TerminalApi terminalCommission POST /terminal/commission_device Commission Terminal
TerminalApi terminalDecommission POST /terminal/decommission_device Decommission Terminal
TerminalApi terminalFetch GET /terminal/{terminal_id} Fetch Terminal
TerminalApi terminalFetchEventStatus GET /terminal/{terminal_id}/event/{event_id} Fetch Event Status
TerminalApi terminalFetchTerminalStatus GET /terminal/{terminal_id}/presence Fetch Terminal Status
TerminalApi terminalList GET /terminal List Terminals
TerminalApi terminalSendEvent POST /terminal/{id}/event Send Event
TerminalApi terminalUpdate PUT /terminal/{terminal_id} Update Terminal
TransactionApi transactionChargeAuthorization POST /transaction/charge_authorization Charge Authorization
TransactionApi transactionDownload GET /transaction/export Export Transactions
TransactionApi transactionEvent GET /transaction/{id}/event Get Transaction Event
TransactionApi transactionFetch GET /transaction/{id} Fetch Transaction
TransactionApi transactionInitialize POST /transaction/initialize Initialize Transaction
TransactionApi transactionList GET /transaction List Transactions
TransactionApi transactionPartialDebit POST /transaction/partial_debit Partial Debit
TransactionApi transactionSession GET /transaction/{id}/session Get Transaction Session
TransactionApi transactionTimeline GET /transaction/timeline/{id} Fetch Transaction Timeline
TransactionApi transactionTotals GET /transaction/totals Transaction Totals
TransactionApi transactionVerify GET /transaction/verify/{reference} Verify Transaction
TransferApi transferBulk POST /transfer/bulk Initiate Bulk Transfer
TransferApi transferDisableOtp POST /transfer/disable_otp Disable OTP requirement for Transfers
TransferApi transferDisableOtpFinalize POST /transfer/disable_otp_finalize Finalize Disabling of OTP requirement for Transfers
TransferApi transferDownload GET /transfer/export Export Transfers
TransferApi transferEnableOtp POST /transfer/enable_otp Enable OTP requirement for Transfers
TransferApi transferFetch GET /transfer/{code} Fetch Transfer
TransferApi transferFinalize POST /transfer/finalize_transfer Finalize Transfer
TransferApi transferInitiate POST /transfer Initiate Transfer
TransferApi transferList GET /transfer List Transfers
TransferApi transferResendOtp POST /transfer/resend_otp Resend OTP for Transfer
TransferApi transferVerify GET /transfer/verify/{reference} Verify Transfer
TransferRecipientApi transferrecipientBulk POST /transferrecipient/bulk Bulk Create Transfer Recipient
TransferRecipientApi transferrecipientCreate POST /transferrecipient Create Transfer Recipient
TransferRecipientApi transferrecipientDelete DELETE /transferrecipient/{code} Delete Transfer Recipient
TransferRecipientApi transferrecipientFetch GET /transferrecipient/{code} Fetch Transfer recipient
TransferRecipientApi transferrecipientList GET /transferrecipient List Transfer Recipients
TransferRecipientApi transferrecipientUpdate PUT /transferrecipient/{code} Update Transfer recipient

Models

Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: Bearer authentication

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

daniel@rossouw.me