Payment Methods

List available payment methods for your Payzava account

Before creating a payment, you need to know which payment methods are available on your account.

Endpoint

GET /payment/methods

Request headers

HeaderRequiredDescription
x-api-keyYesYour API key

Response

{
  "success": true,
  "data": [
    {
      "id": "method_abc123",
      "providerName": "bKash",
      "codeName": "BKASH"
    },
    {
      "id": "method_def456",
      "providerName": "Nagad",
      "codeName": "NAGAD"
    },
    {
      "id": "method_ghi789",
      "providerName": "Rocket",
      "codeName": "ROCKET"
    }
  ]
}

Response fields

FieldDescription
idUnique identifier for the payment method. Use this as paymentMethodId when creating a payment.
providerNameDisplay name of the payment provider (e.g., bKash, Nagad).
codeNameInternal code for the provider.

Example

const axios = require("axios");

const response = await axios.get(
  "https://sandbox.payzava.com/cp/api/v1/payment/methods",
  {
    headers: {
      "Content-Type": "application/json",
      "x-api-key": "sk_sandbox_your_api_key",
    },
  }
);

const methods = response.data.data;

methods.forEach((method) => {
  console.log(`${method.providerName}: ${method.id}`);
});

// Use the `id` from your preferred method as `paymentMethodId`
// when calling POST /payment/create

Using payment methods

The id field from a payment method is what you pass as the paymentMethodId parameter when creating a payment.

Different accounts may have different payment methods enabled depending on their configuration in the Payzava dashboard.