API Reference
Paystack client types, params, and webhook delivery options.
PaystackClientOptions
| Option | Type | Description |
|---|---|---|
baseUrl? | | Override the Paystack API base URL (defaults to https://api.paystack.co |
fetch? | | Custom fetch implementation (useful for tests or proxies). fetch |
maxRetries? | | Maximum retry attempts on transient failures (default: 3). 3 |
publicKey? | | Public key for client-side Paystack Popup integrations. undefined |
secretKey | | Secret key used for API authentication and webhook HMAC verification. |
timeoutMs? | | Request timeout in milliseconds. 30000 |
InitializeTransactionParams
| Prop | Type | Description |
|---|---|---|
amount | | The amount to charge. |
callback_url? | | The callback URL to be called after the transaction is completed. undefined |
channels? | | The channels to be used for the transaction. undefined |
currency? | | The currency of the transaction. undefined |
email | | The email address of the customer. |
metadata? | | Additional metadata about the transaction. undefined |
plan? | | The plan to be used for the transaction. undefined |
reference? | | The reference to be used for the transaction. undefined |
ChargeAuthorizationParams
| Prop | Type | Description |
|---|---|---|
amount | | The amount to charge. |
authorization_code | | The authorization code to be used for the transaction. |
currency? | | The currency of the transaction. undefined |
email | | The email address of the customer. |
metadata? | | Additional metadata about the transaction. undefined |
reference? | | The reference to be used for the transaction. undefined |
CreateCustomerParams
| Prop | Type | Description |
|---|---|---|
email | | The email address of the customer. |
first_name? | | The first name of the customer. undefined |
last_name? | | The last name of the customer. undefined |
metadata? | | Additional metadata about the customer. undefined |
phone? | | The phone number of the customer. undefined |
CreatePlanParams
| Prop | Type | Description |
|---|---|---|
amount | | The amount to charge. |
currency? | | The currency of the transaction. undefined |
description? | | The description of the plan. undefined |
interval | | The interval of the plan. |
invoice_limit? | | The invoice limit of the plan. undefined |
name | | The name of the plan. |
send_invoices? | | Whether to send invoices for the plan. undefined |
send_sms? | | Whether to send SMS for the plan. undefined |
CreateSubscriptionParams
| Prop | Type | Description |
|---|---|---|
authorization? | | The authorization code to be used for the subscription. undefined |
customer | | The customer code to be used for the subscription. |
plan | | The plan code to be used for the subscription. |
start_date? | | The start date of the subscription. undefined |
DisableSubscriptionParams
| Prop | Type | Description |
|---|---|---|
code | | The code of the subscription to disable. |
token | | The token of the subscription to disable. |
WebhookDeliveryStore
| Method | Type | Description |
|---|---|---|
claim | | Atomically claims a webhook delivery for processing.
Returns |
markFailed | | Marks a webhook delivery as failed. |
markProcessed | | Marks a webhook delivery as processed. |
ProcessWebhookDeliveryRequestOptions
| Option | Type | Description |
|---|---|---|
disablePersistence? | | Whether to disable persistence of the webhook delivery. false |
handler | | The handler to process the webhook event. |
store? | | The store to persist the webhook event. undefined |
ProcessWebhookDeliveryOptions
| Option | Type | Description |
|---|---|---|
disablePersistence? | | Whether to disable persistence of the webhook delivery. false |
event | | The webhook event to process. |
handler | | The handler to process the webhook event. |
rawBody | | The raw body of the webhook event. |
store? | | The store to persist the webhook event. undefined |