paystack-customers

Paystack Customers API — create, list, fetch, update, validate identity, whitelist/blacklist, manage authorizations, and direct debit operations. Use this skill whenever creating or managing customer records on Paystack, validating customer identity with BVN or bank account, whitelisting or blacklisting customers by risk action, deactivating saved card authorizations, setting up direct debit mandates, or building customer management dashboards. Also use when you see references to customer_code, CUS_ prefixed codes, risk_action, or /customer/authorization endpoints.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "paystack-customers" with this command: npx skills add rexedge/paystack/rexedge-paystack-paystack-customers

Paystack Customers

The Customers API lets you create and manage customer records on your integration. Customers are automatically created on first charge, but you can also create them explicitly.

Depends on: paystack-setup for the paystackRequest helper and environment config.

Endpoints

MethodEndpointDescription
POST/customerCreate a customer
GET/customerList customers
GET/customer/:email_or_codeFetch a customer
PUT/customer/:codeUpdate a customer
POST/customer/:code/identificationValidate customer identity
POST/customer/set_risk_actionWhitelist/Blacklist a customer
POST/customer/authorization/initializeInitialize authorization
GET/customer/authorization/verify/:referenceVerify authorization
POST/customer/:id/initialize-direct-debitInitialize direct debit
PUT/customer/:id/directdebit-activation-chargeActivate direct debit
GET/customer/:id/directdebit-mandate-authorizationsFetch mandate authorizations
POST/customer/authorization/deactivateDeactivate an authorization

Create Customer

POST /customer

ParamTypeRequiredDescription
emailstringYesCustomer's email address
first_namestringNoCustomer's first name
last_namestringNoCustomer's last name
phonestringNoCustomer's phone number
metadataobjectNoKey/value pairs for additional info

Note: first_name, last_name, and phone become required when assigning a Dedicated Virtual Account to customers in Betting, Financial Services, or General Service business categories.

const customer = await paystackRequest<{
  email: string;
  customer_code: string;
  id: number;
}>("/customer", {
  method: "POST",
  body: JSON.stringify({
    email: "customer@example.com",
    first_name: "Zero",
    last_name: "Sum",
    phone: "+2348123456789",
  }),
});
// customer.data.customer_code → "CUS_xnxdt6s1zg1f4nx"

List Customers

GET /customer

ParamTypeRequiredDescription
perPageintegerNoRecords per page (default: 50)
pageintegerNoPage number (default: 1)
fromdatetimeNoStart date e.g. 2016-09-24T00:00:05.000Z
todatetimeNoEnd date
const customers = await paystackRequest("/customer?perPage=20&page=1");

Fetch Customer

GET /customer/:email_or_code

Returns full customer details including transactions, subscriptions, and authorizations arrays.

const customer = await paystackRequest(
  `/customer/${encodeURIComponent("CUS_xnxdt6s1zg1f4nx")}`
);
// Includes: customer.data.authorizations[].authorization_code

Update Customer

PUT /customer/:code

await paystackRequest(`/customer/${encodeURIComponent("CUS_xnxdt6s1zg1f4nx")}`, {
  method: "PUT",
  body: JSON.stringify({
    first_name: "BoJack",
    last_name: "Horseman",
  }),
});

Validate Customer Identity

POST /customer/:code/identification

Validates a customer's identity via bank account verification. Returns 202 Accepted — validation happens asynchronously. Listen for customeridentification.success or customeridentification.failed webhooks.

ParamTypeRequiredDescription
countrystringYes2-letter country code (e.g. NG)
typestringYesbank_account (only supported type)
account_numberstringYesCustomer's bank account number
bvnstringYesBank Verification Number
bank_codestringYesBank code (from List Banks endpoint)
first_namestringYesCustomer's first name
last_namestringYesCustomer's last name
middle_namestringNoCustomer's middle name
await paystackRequest(
  `/customer/${encodeURIComponent("CUS_xnxdt6s1zg1f4nx")}/identification`,
  {
    method: "POST",
    body: JSON.stringify({
      country: "NG",
      type: "bank_account",
      account_number: "0123456789",
      bvn: "20012345677",
      bank_code: "007",
      first_name: "Asta",
      last_name: "Lavista",
    }),
  }
);
// Returns: { status: true, message: "Customer Identification in progress" }

Whitelist / Blacklist Customer

POST /customer/set_risk_action

ParamTypeRequiredDescription
customerstringYesCustomer code or email
risk_actionstringNodefault, allow (whitelist), or deny (blacklist)
await paystackRequest("/customer/set_risk_action", {
  method: "POST",
  body: JSON.stringify({
    customer: "CUS_xr58yrr2ujlft9k",
    risk_action: "deny", // Blacklist this customer
  }),
});

Initialize Authorization

POST /customer/authorization/initialize

Create a reusable authorization code for recurring direct debit transactions.

ParamTypeRequiredDescription
emailstringYesCustomer's email
channelstringYesdirect_debit (only supported option)
callback_urlstringNoURL to redirect customer after authorization
accountobjectNo{ number, bank_code } for bank account details
addressobjectNo{ street, city, state } for customer address
const auth = await paystackRequest<{
  redirect_url: string;
  access_code: string;
  reference: string;
}>("/customer/authorization/initialize", {
  method: "POST",
  body: JSON.stringify({
    email: "customer@email.com",
    channel: "direct_debit",
    callback_url: "https://example.com/callback",
  }),
});
// Redirect customer to auth.data.redirect_url

Verify Authorization

GET /customer/authorization/verify/:reference

const result = await paystackRequest(
  `/customer/authorization/verify/${encodeURIComponent(reference)}`
);
// result.data.authorization_code, result.data.active

Initialize Direct Debit

POST /customer/:id/initialize-direct-debit

Link a bank account to a customer for direct debit transactions.

const result = await paystackRequest(
  `/customer/${customerId}/initialize-direct-debit`,
  {
    method: "POST",
    body: JSON.stringify({
      account: { number: "0123456789", bank_code: "058" },
      address: { street: "Some Where", city: "Ikeja", state: "Lagos" },
    }),
  }
);
// Redirect customer to result.data.redirect_url

Direct Debit Activation Charge

PUT /customer/:id/directdebit-activation-charge

Trigger an activation charge on an inactive mandate.

await paystackRequest(`/customer/${customerId}/directdebit-activation-charge`, {
  method: "PUT",
  body: JSON.stringify({ authorization_id: 1069309917 }),
});

Fetch Mandate Authorizations

GET /customer/:id/directdebit-mandate-authorizations

const mandates = await paystackRequest(
  `/customer/${customerId}/directdebit-mandate-authorizations`
);
// mandates.data[].status, mandates.data[].authorization_code

Deactivate Authorization

POST /customer/authorization/deactivate

Permanently deactivate a saved card/authorization so it can no longer be used for charges.

await paystackRequest("/customer/authorization/deactivate", {
  method: "POST",
  body: JSON.stringify({
    authorization_code: "AUTH_xxxIjkZVj5",
  }),
});

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

paystack-setup

No summary provided by upstream source.

Repository SourceNeeds Review
General

paystack-charges

No summary provided by upstream source.

Repository SourceNeeds Review
General

paystack-webhooks

No summary provided by upstream source.

Repository SourceNeeds Review
General

paystack-settlements

No summary provided by upstream source.

Repository SourceNeeds Review