g14o
Packages@g14o/paystack

API Reference

Paystack client types, params, and webhook delivery options.

PaystackClientOptions

OptionTypeDescription
baseUrl?string

Override the Paystack API base URL (defaults to https://api.paystack.co).

Default: https://api.paystack.co
fetch?function

Custom fetch implementation (useful for tests or proxies).

Default: fetch
maxRetries?number

Maximum retry attempts on transient failures (default: 3).

Default: 3
publicKey?string

Public key for client-side Paystack Popup integrations.

Default: undefined
secretKeystring

Secret key used for API authentication and webhook HMAC verification.

timeoutMs?number

Request timeout in milliseconds.

Default: 30000

InitializeTransactionParams

PropTypeDescription
amountnumber

The amount to charge.

callback_url?string

The callback URL to be called after the transaction is completed.

Default: undefined
channels?array

The channels to be used for the transaction.

Default: undefined
currency?string

The currency of the transaction.

Default: undefined
emailstring

The email address of the customer.

metadata?Record<string, unknown>

Additional metadata about the transaction.

Default: undefined
plan?string

The plan to be used for the transaction.

Default: undefined
reference?string

The reference to be used for the transaction.

Default: undefined

ChargeAuthorizationParams

PropTypeDescription
amountnumber

The amount to charge.

authorization_codestring

The authorization code to be used for the transaction.

currency?string

The currency of the transaction.

Default: undefined
emailstring

The email address of the customer.

metadata?Record<string, unknown>

Additional metadata about the transaction.

Default: undefined
reference?string

The reference to be used for the transaction.

Default: undefined

CreateCustomerParams

PropTypeDescription
emailstring

The email address of the customer.

first_name?string

The first name of the customer.

Default: undefined
last_name?string

The last name of the customer.

Default: undefined
metadata?Record<string, unknown>

Additional metadata about the customer.

Default: undefined
phone?string

The phone number of the customer.

Default: undefined

CreatePlanParams

PropTypeDescription
amountnumber

The amount to charge.

currency?string

The currency of the transaction.

Default: undefined
description?string

The description of the plan.

Default: undefined
intervalstring

The interval of the plan.

invoice_limit?number

The invoice limit of the plan.

Default: undefined
namestring

The name of the plan.

send_invoices?boolean | undefined

Whether to send invoices for the plan.

Default: undefined
send_sms?boolean | undefined

Whether to send SMS for the plan.

Default: undefined

CreateSubscriptionParams

PropTypeDescription
authorization?string

The authorization code to be used for the subscription.

Default: undefined
customerstring

The customer code to be used for the subscription.

planstring

The plan code to be used for the subscription.

start_date?string

The start date of the subscription.

Default: undefined

DisableSubscriptionParams

PropTypeDescription
codestring

The code of the subscription to disable.

tokenstring

The token of the subscription to disable.

WebhookDeliveryStore

MethodTypeDescription
claimfunction

Atomically claims a webhook delivery for processing. Returns duplicate when the event was already processed or is in-flight.

markFailedfunction

Marks a webhook delivery as failed.

markProcessedfunction

Marks a webhook delivery as processed.

ProcessWebhookDeliveryRequestOptions

OptionTypeDescription
disablePersistence?boolean | undefined

Whether to disable persistence of the webhook delivery.

Default: false
handlerfunction

The handler to process the webhook event.

store?object

The store to persist the webhook event.

Default: undefined

ProcessWebhookDeliveryOptions

OptionTypeDescription
disablePersistence?boolean | undefined

Whether to disable persistence of the webhook delivery.

Default: false
eventPaystackWebhookEvent

The webhook event to process.

handlerfunction

The handler to process the webhook event.

rawBodystring

The raw body of the webhook event.

store?object

The store to persist the webhook event.

Default: undefined

On this page