Storefront
A collection of endpoints for creating and managing storefronts
Copy link List Storefronts
List the storefronts you previously created
Query Parameters
Number of records to fetch per request
The offset to retrieve data from
Enumactiveinactive
Response
200Storefront List response
5 object properties
GET
/storefrontcurl https://api.paystack.co/storefront \
-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.storefront.list({
perPage: 100,
page: 100
});
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.storefront.list({
per_page: 100,
page: 100
})
puts response.dataResponse
{
"status": true,
"message": "Storefronts retrieved",
"data": [
{
"id": 1559046,
"name": "My Storefront",
"slug": "my-storefront",
"description": "A description of my storefront",
"status": "active",
"currency": "NGN",
"createdAt": "2024-11-01T12:00:00.000Z",
"updatedAt": "2024-11-01T12:00:00.000Z"
}
],
"meta": {
"total": 1,
"skipped": 0,
"perPage": 50,
"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 Storefront
Create a digital shop to manage and display your products
Request Body
Name of the storefront
A unique identifier to access your store. Once the storefront is created, it can be accessed from https://paystack.shop/your-slug
Currency for prices of products in your storefront.
EnumGHSKESNGNUSDZAR
The description of the storefront
Response
200Storefront Create response
22 object properties
POST
/storefrontcurl https://api.paystack.co/storefront \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Obi and Sons",
"slug": "obi_and_sons",
"currency": "GHS"
}' \
-X POSTimport { Paystack } from "@paystack/paystack-sdk";
const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });
const response = await paystack.storefront.create({
name: "Obi and Sons",
slug: "obi_and_sons",
currency: "GHS"
});
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.storefront.create({
name: "Obi and Sons",
slug: "obi_and_sons",
currency: "GHS"
})
puts response.dataResponse
{
"status": true,
"message": "Storefront created",
"data": {
"id": 1559046,
"name": "My Storefront",
"slug": "my-storefront",
"description": "A description of my storefront",
"status": "inactive",
"currency": "NGN",
"createdAt": "2024-11-01T12:00:00.000Z",
"updatedAt": "2024-11-01T12:00:00.000Z"
}
}{
"status": false,
"message": "An error occurred",
"meta": {
"nextStep": "string"
},
"type": "string",
"code": "validation_error",
"errorCodeMappingNotFound": true
}Copy link Fetch Storefront
Get the details of a previously created Storefront
Path Parameters
The unique identifier of the Storefront
Response
200Storefront Fetch response
22 object properties
6 object properties
GET
/storefront/{id}curl https://api.paystack.co/storefront/1559046 \
-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.storefront.fetch("1559046");
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.storefront.fetch("1559046")
puts response.dataResponse
{
"status": true,
"message": "Storefront retrieved",
"data": {
"id": 1559046,
"name": "My Storefront",
"slug": "my-storefront",
"description": "A description of my storefront",
"status": "active",
"currency": "NGN",
"createdAt": "2024-11-01T12:00:00.000Z",
"updatedAt": "2024-11-01T12:00:00.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 Update Storefront
Update the details of a previously created Storefront
Path Parameters
The unique identifier of the Storefront
Request Body
Name of the storefront
A unique identifier to access your store. Once the storefront is created, it can be accessed from
https://paystack.shop/your-slug
The description of the storefront
Response
200Storefront Update response
PUT
/storefront/{id}curl https://api.paystack.co/storefront/1559046 \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "NAME",
"slug": "SLUG"
}' \
-X PUTimport { Paystack } from "@paystack/paystack-sdk";
const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });
const response = await paystack.storefront.update("1559046", {
name: "NAME",
slug: "SLUG"
});
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.storefront.update("1559046", {
name: "NAME",
slug: "SLUG"
})
puts response.dataResponse
{
"status": true,
"message": "Storefront updated",
"data": {
"id": 1559046,
"name": "Updated Storefront Name",
"slug": "my-storefront",
"description": "An updated description",
"status": "active",
"currency": "NGN",
"createdAt": "2024-11-01T12:00:00.000Z",
"updatedAt": "2024-11-01T14:00:00.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 Delete Storefront
Delete a previously created Storefront
Path Parameters
The unique identifier of the Storefront
Response
200Storefront Delete response
DELETE
/storefront/{id}curl https://api.paystack.co/storefront/1559046 \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-X DELETEimport { Paystack } from "@paystack/paystack-sdk";
const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });
const response = await paystack.storefront.delete("1559046");
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.storefront.delete_("1559046")
puts response.dataResponse
{
"status": true,
"message": "Storefront deleted"
}{
"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 Verify Storefront Slug
Verify the availability of a slug before using it for your Storefront
Path Parameters
The custom slug to check
Response
200Request successful
GET
/storefront/verify/{slug}curl https://api.paystack.co/storefront/verify/struct_and_faces \
-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.storefront.verifySlug("struct_and_faces");
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.storefront.verify_slug("struct_and_faces")
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 Fetch Storefront Orders
Fetch all orders in your Storefront
Path Parameters
The unique identifier of the Storefront
Response
200Request successful
GET
/storefront/{id}/ordercurl https://api.paystack.co/storefront/1559046/order \
-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.storefront.fetchOrders("1559046");
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.storefront.fetch_orders("1559046")
puts response.dataResponse
{
"status": true,
"message": "Orders retrieved",
"data": [
{
"id": 12345,
"code": "ORD_abc123def456",
"amount": 50000,
"currency": "NGN",
"status": "success",
"customer": {
"email": "[email protected]"
},
"createdAt": "2024-11-01T12:00:00.000Z"
}
],
"meta": {
"total": 1,
"skipped": 0,
"perPage": 50,
"page": 1,
"pageCount": 1
}
}{
"status": false,
"message": "An error occurred",
"meta": {
"nextStep": "string"
},
"type": "string",
"code": "validation_error",
"errorCodeMappingNotFound": true
}Copy link List Storefront Products
List the products in a Storefront
Path Parameters
The unique identifier of the Storefront
Response
200Request successful
GET
/storefront/{id}/productcurl https://api.paystack.co/storefront/1559046/product \
-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.storefront.listProducts("1559046");
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.storefront.list_products("1559046")
puts response.dataResponse
{
"status": true,
"message": "Products retrieved",
"data": [
{
"id": 2196244,
"name": "Sample Product",
"description": "A sample product",
"price": 10000,
"currency": "NGN",
"active": true
}
],
"meta": {
"total": 1,
"skipped": 0,
"perPage": 50,
"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 Add Products to Storefront
Add previously created products to a Storefront
Path Parameters
The unique identifier of the Storefront
Request Body
An array of product IDs
Response
200Request successful
POST
/storefront/{id}/productcurl https://api.paystack.co/storefront/1559046/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.storefront.addProducts("1559046", {
products: []
});
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.storefront.add_products("1559046", {
products: []
})
puts response.dataResponse
{
"status": true,
"message": "Products added to storefront"
}{
"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 Publish Storefront
Make your Storefront publicly available
Path Parameters
The unique identifier of the Storefront
Response
200Request successful
POST
/storefront/{id}/publishcurl https://api.paystack.co/storefront/1559046/publish \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-X POSTimport { Paystack } from "@paystack/paystack-sdk";
const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });
const response = await paystack.storefront.publish("1559046");
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.storefront.publish("1559046")
puts response.dataResponse
{
"status": true,
"message": "Storefront published"
}{
"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 Duplicate Storefront
Duplicate a previously created Storefront
Path Parameters
The unique identifier of the Storefront
Response
200Request successful
POST
/storefront/{id}/duplicatecurl https://api.paystack.co/storefront/1559046/duplicate \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-X POSTimport { Paystack } from "@paystack/paystack-sdk";
const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });
const response = await paystack.storefront.duplicate("1559046");
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.storefront.duplicate("1559046")
puts response.dataResponse
{
"status": true,
"message": "Storefront duplicated"
}{
"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
}