Page

A collection of endpoints for creating and managing links for the collection of payment for products

Copy link List Pages

List all previously created payment pages

Query Parameters

perPageinteger
Number of records to fetch per page
pageinteger
The section to retrieve
fromstring
The start date
tostring
The end date

Response

200Page List response
statusrequiredboolean
messagerequiredstring
datarequiredarray[object]
metarequiredobject
5 object properties
totalrequiredinteger
skippedrequiredinteger
perPagerequiredinteger
pagerequiredinteger
pageCountrequiredinteger
GET/page
curl https://api.paystack.co/page \
  -H "Authorization: Bearer YOUR_SECRET_KEY"
import { Paystack } from "@paystack/paystack-sdk";

const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });

const response = await paystack.page.list({
  perPage: 10,
  page: 100
});
console.log(response.data);
require "paystack"

paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))

response = paystack.page.list({
  per_page: 10,
  page: 100
})
puts response.data
Response
{
  "status": true,
  "message": "Pages retrieved",
  "data": [
    {
      "integration": 100073,
      "plan": 1716,
      "domain": "test",
      "name": "Subscribe to plan: Weekly small chops",
      "description": null,
      "amount": null,
      "currency": "NGN",
      "slug": "sR7Ohx2iVd",
      "custom_fields": null,
      "redirect_url": null,
      "active": true,
      "migrate": null,
      "id": 2223,
      "createdAt": "2016-10-01T10:59:11.000Z",
      "updatedAt": "2016-10-01T10:59:11.000Z"
    },
    {
      "integration": 100073,
      "plan": null,
      "domain": "test",
      "name": "Special",
      "description": "Special page",
      "amount": 10000,
      "currency": "NGN",
      "slug": "special-me",
      "custom_fields": [
        {
          "display_name": "Speciality",
          "variable_name": "speciality"
        },
        {
          "display_name": "Age",
          "variable_name": "age"
        }
      ],
      "redirect_url": "http://special.url",
      "active": true,
      "migrate": null,
      "id": 1807,
      "createdAt": "2016-09-09T19:18:37.000Z",
      "updatedAt": "2016-09-14T17:51:49.000Z"
    }
  ],
  "meta": {
    "total": 2,
    "skipped": 0,
    "perPage": "3",
    "page": 1,
    "pageCount": 1
  }
}
{
  "status": false,
  "message": "An error occurred",
  "meta": {
    "nextStep": "string"
  },
  "type": "string",
  "code": "validation_error",
  "errorCodeMappingNotFound": true
}
{
  "status": false,
  "message": "An error occurred",
  "meta": {
    "nextStep": "string"
  },
  "type": "string",
  "code": "validation_error",
  "errorCodeMappingNotFound": true
}

Copy link Create Page

Create a webpage to receive payments

Request Body

namerequiredstring
Name of page
descriptionstring
The description of the page
amountinteger
Amount should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR
currencystring
The transaction currency. Defaults to your integration currency.
EnumNGNGHSZARKESUSD
slugstring
URL slug you would like to be associated with this page. Page will be accessible at `https://paystack.com/pay/[slug]`
typestring
The type of payment page to create. Defaults to `payment` if no type is specified.
Enumpaymentsubscriptionproductplan
planstring
The ID of the plan to subscribe customers on this payment page to when `type` is set to `subscription`.
fixed_amountboolean
Specifies whether to collect a fixed amount on the payment page. If true, `amount` must be passed.
split_codestring
The split code of the transaction split. e.g. `SPL_98WF13Eb3w`
metadataobject
JSON object of custom data
redirect_urlstring
If you would like Paystack to redirect to a URL upon successful payment, specify the URL here.
success_messagestring
A success message to display to the customer after a successful transaction
notification_emailstring
An email address that will receive transaction notifications for this payment page
collect_phoneboolean
Specify whether to collect phone numbers on the payment page
custom_fieldsarray[object]
If you would like to accept custom fields, specify them here.

Response

200Page Create response
statusrequiredboolean
messagerequiredstring
datarequiredobject
13 object properties
namerequiredstring
integrationrequiredinteger
domainrequiredstring
slugrequiredstring
currencyrequiredstring
typerequiredstring
collect_phonerequiredboolean
activerequiredboolean
publishedrequiredboolean
migraterequiredboolean
idrequiredinteger
createdAtrequiredstring
updatedAtrequiredstring
POST/page
curl https://api.paystack.co/page \
  -H "Authorization: Bearer YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Extra Charges"
  }' \
  -X POST
import { Paystack } from "@paystack/paystack-sdk";

const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });

const response = await paystack.page.create({
  name: "Extra Charges"
});
console.log(response.data);
require "paystack"

paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))

response = paystack.page.create({
  name: "Extra Charges"
})
puts response.data
Response
{
  "status": true,
  "message": "Page created",
  "data": {
    "name": "Onipan and Hassan",
    "description": "",
    "amount": 10000,
    "split_code": "SPL_yqSS1FvrBz",
    "integration": 463433,
    "domain": "test",
    "slug": "1got2y8unp",
    "currency": "NGN",
    "type": "payment",
    "collect_phone": false,
    "active": true,
    "published": true,
    "migrate": false,
    "id": 1308510,
    "createdAt": "2023-03-21T11:44:16.412Z",
    "updatedAt": "2023-03-21T11:44:16.412Z"
  }
}
{
  "status": false,
  "message": "An error occurred",
  "meta": {
    "nextStep": "string"
  },
  "type": "string",
  "code": "validation_error",
  "errorCodeMappingNotFound": true
}

Copy link Fetch Page

Get a previously created payment page

Path Parameters

idrequiredinteger
The unique identifier of a payment page

Response

200Page Fetch response
statusrequiredboolean
messagerequiredstring
datarequiredobject
21 object properties
integrationrequiredinteger
domainrequiredstring
namerequiredstring
descriptionrequiredstring
amountrequiredinteger
currencyrequiredstring
slugrequiredstring
custom_fieldsrequiredstring
typerequiredstring
redirect_urlrequiredstring
success_messagerequiredstring
collect_phonerequiredboolean
activerequiredboolean
publishedrequiredboolean
migraterequiredboolean
notification_emailrequiredstring
metadatarequiredstring
split_coderequiredstring
idrequiredinteger
createdAtrequiredstring
updatedAtrequiredstring
GET/page/{id}
curl https://api.paystack.co/page/1891222 \
  -H "Authorization: Bearer YOUR_SECRET_KEY"
import { Paystack } from "@paystack/paystack-sdk";

const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });

const response = await paystack.page.fetch("1891222");
console.log(response.data);
require "paystack"

paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))

response = paystack.page.fetch("1891222")
puts response.data
Response
{
  "status": true,
  "message": "Page retrieved",
  "data": {
    "integration": 100032,
    "domain": "test",
    "name": "Offering collections",
    "description": "Give unto the Lord, and it shall be multiplied ten-fold to you.",
    "amount": null,
    "currency": "NGN",
    "slug": "5nApBwZkvY",
    "active": true,
    "id": 18,
    "createdAt": "2016-03-30T00:49:57.000Z",
    "updatedAt": "2016-03-30T00:49:57.000Z",
    "products": [
      {
        "product_id": 523,
        "name": "Product Four",
        "description": "Product Four Description",
        "product_code": "PROD_l9p81u9pkjqjunb",
        "page": 18,
        "price": 500000,
        "currency": "NGN",
        "quantity": 0,
        "type": "good",
        "features": null,
        "is_shippable": 0,
        "domain": "test",
        "integration": 343288,
        "active": 1,
        "in_stock": 1
      },
      {
        "product_id": 522,
        "name": "Product Five",
        "description": "Product Five Description",
        "product_code": "PROD_8ne9cxutagmtsyz",
        "page": 18,
        "price": 500000,
        "currency": "NGN",
        "quantity": 0,
        "type": "good",
        "features": null,
        "is_shippable": 0,
        "domain": "test",
        "integration": 343288,
        "active": 1,
        "in_stock": 0
      }
    ]
  }
}
{
  "status": false,
  "message": "An error occurred",
  "meta": {
    "nextStep": "string"
  },
  "type": "string",
  "code": "validation_error",
  "errorCodeMappingNotFound": true
}
{
  "status": false,
  "message": "An error occurred",
  "meta": {
    "nextStep": "string"
  },
  "type": "string",
  "code": "validation_error",
  "errorCodeMappingNotFound": true
}

Copy link Update Page

Update a previously created payment page

Path Parameters

idrequiredinteger
The unique identifier of a payment page

Request Body

namestring
Name of page
descriptionstring
The description of the page
amountinteger
Amount should be in the subunit of the currency
activeboolean
Set to false to deactivate page url

Response

200Page Update response
statusrequiredboolean
messagerequiredstring
datarequiredobject
22 object properties
domainrequiredstring
namerequiredstring
descriptionrequiredstring
amountrequiredstring
currencyrequiredstring
slugrequiredstring
custom_fieldsrequiredstring
typerequiredstring
redirect_urlrequiredstring
success_messagerequiredstring
collect_phonerequiredboolean
activerequiredboolean
publishedrequiredboolean
migraterequiredboolean
notification_emailrequiredstring
metadatarequiredstring
split_coderequiredstring
idrequiredinteger
integrationrequiredinteger
planrequiredstring
createdAtrequiredstring
updatedAtrequiredstring
PUT/page/{id}
curl https://api.paystack.co/page/1891222 \
  -H "Authorization: Bearer YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Backyard Sale",
    "description": "DESCRIPTION"
  }' \
  -X PUT
import { Paystack } from "@paystack/paystack-sdk";

const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });

const response = await paystack.page.update("1891222", {
  name: "Backyard Sale",
  description: "DESCRIPTION"
});
console.log(response.data);
require "paystack"

paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))

response = paystack.page.update("1891222", {
  name: "Backyard Sale",
  description: "DESCRIPTION"
})
puts response.data
Response
{
  "status": true,
  "message": "Page updated",
  "data": {
    "domain": "test",
    "name": "Buttercup Brunch",
    "description": "Gather your friends for the ritual that is brunch",
    "amount": null,
    "currency": "NGN",
    "slug": "5nApBwZkvY",
    "active": true,
    "id": 18,
    "integration": 100032,
    "createdAt": "2016-03-30T00:49:57.000Z",
    "updatedAt": "2016-03-30T04:44:35.000Z"
  }
}
{
  "status": false,
  "message": "An error occurred",
  "meta": {
    "nextStep": "string"
  },
  "type": "string",
  "code": "validation_error",
  "errorCodeMappingNotFound": true
}
{
  "status": false,
  "message": "An error occurred",
  "meta": {
    "nextStep": "string"
  },
  "type": "string",
  "code": "validation_error",
  "errorCodeMappingNotFound": true
}

Copy link Check Slug Availability

Check if a custom slug is available for use when creating a payment page

Path Parameters

slugrequiredstring
The custom slug to check

Response

200Page Check Slug Availability response
statusrequiredboolean
messagerequiredstring
GET/page/check_slug_availability/{slug}
curl https://api.paystack.co/page/check_slug_availability/risky-burger \
  -H "Authorization: Bearer YOUR_SECRET_KEY"
import { Paystack } from "@paystack/paystack-sdk";

const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });

const response = await paystack.page.checkSlugAvailability("risky-burger");
console.log(response.data);
require "paystack"

paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))

response = paystack.page.check_slug_availability("risky-burger")
puts response.data
Response
{
  "status": true,
  "message": "Slug is available"
}
{
  "status": false,
  "message": "An error occurred",
  "meta": {
    "nextStep": "string"
  },
  "type": "string",
  "code": "validation_error",
  "errorCodeMappingNotFound": true
}
{
  "status": false,
  "message": "An error occurred",
  "meta": {
    "nextStep": "string"
  },
  "type": "string",
  "code": "validation_error",
  "errorCodeMappingNotFound": true
}

Copy link Add Products

Add products to a previously created payment page. You can only add products to pages that was created with a `product` type.

Path Parameters

idrequiredstring

Request Body

productsrequiredarray[integer]
A list of IDs of products to add to a page.

Response

200Page Add Products response
statusrequiredboolean
messagerequiredstring
datarequiredobject
23 object properties
integrationrequiredinteger
planrequiredstring
domainrequiredstring
namerequiredstring
descriptionrequiredstring
amountrequiredstring
currencyrequiredstring
slugrequiredstring
custom_fieldsrequiredstring
typerequiredstring
redirect_urlrequiredstring
success_messagerequiredstring
collect_phonerequiredboolean
activerequiredboolean
publishedrequiredboolean
migraterequiredboolean
notification_emailrequiredstring
metadatarequiredstring
split_coderequiredstring
idrequiredinteger
createdAtrequiredstring
updatedAtrequiredstring
productsrequiredarray[object]
POST/page/{id}/product
curl https://api.paystack.co/page/PAGE_ID/product \
  -H "Authorization: Bearer YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "products": []
  }' \
  -X POST
import { Paystack } from "@paystack/paystack-sdk";

const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });

const response = await paystack.page.addProducts("PAGE_ID", {
  products: []
});
console.log(response.data);
require "paystack"

paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))

response = paystack.page.add_products("PAGE_ID", {
  products: []
})
puts response.data
Response
{
  "status": true,
  "message": "Products added to page",
  "data": {
    "integration": 343288,
    "plan": null,
    "domain": "test",
    "name": "Demo Products Page",
    "description": "Demo Products Page",
    "amount": null,
    "currency": "NGN",
    "slug": "demoproductspage",
    "custom_fields": [],
    "type": "product",
    "redirect_url": null,
    "success_message": null,
    "collect_phone": false,
    "active": true,
    "published": true,
    "migrate": true,
    "notification_email": null,
    "metadata": {},
    "id": 102859,
    "createdAt": "2019-06-29T16:21:24.000Z",
    "updatedAt": "2019-06-29T16:28:11.000Z",
    "products": [
      {
        "product_id": 523,
        "name": "Product Four",
        "description": "Product Four Description",
        "product_code": "PROD_l9p81u9pkjqjunb",
        "page": 102859,
        "price": 500000,
        "currency": "NGN",
        "quantity": 0,
        "type": "good",
        "features": null,
        "is_shippable": 0,
        "domain": "test",
        "integration": 343288,
        "active": 1,
        "in_stock": 1
      }
    ]
  }
}
{
  "status": false,
  "message": "An error occurred",
  "meta": {
    "nextStep": "string"
  },
  "type": "string",
  "code": "validation_error",
  "errorCodeMappingNotFound": true
}