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
Number of records to fetch per page
The section to retrieve
The start date
The end date
Response
200Page List response
5 object properties
GET
/pagecurl 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.dataResponse
{
"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
Name of page
The description of the page
Amount should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR
The transaction currency. Defaults to your integration currency.
EnumNGNGHSZARKESUSD
URL slug you would like to be associated with this page. Page will be accessible at `https://paystack.com/pay/[slug]`
The type of payment page to create. Defaults to `payment` if no type is specified.
Enumpaymentsubscriptionproductplan
The ID of the plan to subscribe customers on this payment page to when `type` is set to `subscription`.
Specifies whether to collect a fixed amount on the payment page. If true, `amount` must be passed.
The split code of the transaction split. e.g. `SPL_98WF13Eb3w`
JSON object of custom data
If you would like Paystack to redirect to a URL upon successful payment, specify the URL here.
A success message to display to the customer after a successful transaction
An email address that will receive transaction notifications for this payment page
Specify whether to collect phone numbers on the payment page
If you would like to accept custom fields, specify them here.
Response
200Page Create response
13 object properties
POST
/pagecurl https://api.paystack.co/page \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Extra Charges"
}' \
-X POSTimport { 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.dataResponse
{
"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
The unique identifier of a payment page
Response
200Page Fetch response
21 object properties
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.dataResponse
{
"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
The unique identifier of a payment page
Request Body
Name of page
The description of the page
Amount should be in the subunit of the currency
Set to false to deactivate page url
Response
200Page Update response
22 object properties
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 PUTimport { 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.dataResponse
{
"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
The custom slug to check
Response
200Page Check Slug Availability response
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.dataResponse
{
"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
Request Body
A list of IDs of products to add to a page.
Response
200Page Add Products response
23 object properties
POST
/page/{id}/productcurl https://api.paystack.co/page/PAGE_ID/product \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"products": []
}' \
-X POSTimport { 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.dataResponse
{
"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
}