Product
A collection of endpoints for creating and managing inventories
Copy link List Products
List all previously created products
Query Parameters
Number of records to fetch per page
The section to retrieve
The state of the product
The start date
The end date
Response
200Product Lists response
5 object properties
GET
/productcurl https://api.paystack.co/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.product.list({
perPage: 100,
page: 100
});
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.product.list({
per_page: 100,
page: 100
})
puts response.dataResponse
{
"status": true,
"message": "Products retrieved",
"data": [
{
"id": 795638,
"name": "Mimshack",
"description": "Everything cars",
"product_code": "PROD_22deobcvbht2dfe",
"slug": "mimshack-yiuedh",
"currency": "NGN",
"price": 50000,
"quantity": 10,
"quantity_sold": 0,
"active": true,
"domain": "test",
"type": "good",
"in_stock": true,
"unlimited": false,
"metadata": {
"background_color": "#F5F5F5"
},
"files": [],
"success_message": null,
"redirect_url": null,
"split_code": null,
"notification_emails": null,
"minimum_orderable": 1,
"maximum_orderable": null,
"createdAt": "2022-04-12T11:21:43.000Z",
"updatedAt": "2022-04-12T11:21:43.000Z",
"digital_assets": [],
"variant_options": [],
"is_shippable": true,
"shipping_fields": {
"delivery_note": "disabled"
},
"integration": 463433,
"low_stock_alert": 0
},
{
"id": 682324,
"name": "Nike Air 23",
"description": "Just do it!",
"product_code": "PROD_4vg503b3qga3vul",
"slug": "nike-air-23-gylbao",
"currency": "NGN",
"price": 25000000,
"quantity": 7,
"quantity_sold": 0,
"active": true,
"domain": "test",
"type": "good",
"in_stock": true,
"unlimited": false,
"metadata": {
"background_color": "#05090b"
},
"files": [
{
"key": "products/2eppxpcv5mqdulp7l410.jpeg",
"type": "image",
"path": "https://res.cloudinary.com/paystack/image/upload/public/files/products/2eppxpcv5mqdulp7l410.jpeg",
"original_filename": "download.jpeg"
}
],
"success_message": "Thanks for your order",
"redirect_url": "https://nike.com",
"split_code": null,
"notification_emails": null,
"minimum_orderable": 1,
"maximum_orderable": null,
"createdAt": "2022-03-02T11:48:09.000Z",
"updatedAt": "2022-03-02T11:50:57.000Z",
"digital_assets": [],
"variant_options": [],
"is_shippable": true,
"shipping_fields": {
"delivery_note": "optional",
"shipping_fees": [
{
"region": "Ikeja",
"fee": 100000,
"currency": "NGN"
},
{
"region": "Yaba",
"fee": 150000,
"currency": "NGN"
},
{
"region": "Rest of Lagos",
"fee": 300000,
"currency": "NGN"
}
]
},
"integration": 463433,
"low_stock_alert": 0
},
{
"id": 489399,
"name": "Puff Puff",
"description": "Crispy flour ball with fluffy interior",
"product_code": "PROD_ddot3upakgl3ejt",
"slug": "puff-puff-prqnxc",
"currency": "NGN",
"price": 5000,
"quantity": 100,
"quantity_sold": 0,
"active": true,
"domain": "test",
"type": "good",
"in_stock": true,
"unlimited": false,
"metadata": {
"background_color": "#F5F5F5"
},
"files": [],
"success_message": null,
"redirect_url": null,
"split_code": null,
"notification_emails": null,
"minimum_orderable": 1,
"maximum_orderable": null,
"createdAt": "2021-11-08T14:39:37.000Z",
"updatedAt": "2021-11-08T14:39:37.000Z",
"digital_assets": [],
"variant_options": [],
"is_shippable": true,
"shipping_fields": {
"delivery_note": "disabled"
},
"integration": 463433,
"low_stock_alert": 0
}
],
"meta": {
"total": 3,
"skipped": 0,
"perPage": 50,
"page": 1,
"pageCount": 1
}
}{
"status": false,
"message": "Invalid Key"
}{
"status": false,
"message": "An error occurred",
"meta": {
"nextStep": "string"
},
"type": "string",
"code": "validation_error",
"errorCodeMappingNotFound": true
}Copy link Create Product
Create a new product on your integration
Request Body
Name of product
The description of the product
Price should be in kobo if currency is NGN, pesewas, if currency is GHS,
and cents, if currency is ZAR
Currency in which price is set. Allowed values are: NGN, GHS, ZAR or USD
Set to true if the product has unlimited stock. Leave as false if the
product has limited stock
Number of products in stock. Use if limited is true
The split code if sharing the transaction with partners
Stringified JSON object of custom data
Response
201Product Create response
28 object properties
3 object properties
1 object property
POST
/productcurl https://api.paystack.co/product \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Cups",
"description": "Environment friendly paper cups",
"price": 10000,
"currency": "NGN"
}' \
-X POSTimport { Paystack } from "@paystack/paystack-sdk";
const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });
const response = await paystack.product.create({
name: "Cups",
description: "Environment friendly paper cups",
price: 10000,
currency: "NGN"
});
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.product.create({
name: "Cups",
description: "Environment friendly paper cups",
price: 10000,
currency: "NGN"
})
puts response.dataResponse
{
"status": true,
"message": "Product successfully created",
"data": {
"name": "Puff Puff",
"description": "Crispy flour ball with fluffy interior",
"currency": "NGN",
"price": 5000,
"quantity": 100,
"is_shippable": true,
"unlimited": false,
"integration": 463433,
"domain": "test",
"metadata": {
"background_color": "#F5F5F5"
},
"slug": "puff-puff-prqnxc",
"product_code": "PROD_ddot3upakgl3ejt",
"quantity_sold": 0,
"type": "good",
"shipping_fields": {
"delivery_note": "disabled"
},
"active": true,
"in_stock": true,
"minimum_orderable": 1,
"maximum_orderable": null,
"low_stock_alert": false,
"id": 489399,
"createdAt": "2021-11-08T14:39:37.303Z",
"updatedAt": "2021-11-08T14:39:37.303Z"
}
}{
"status": false,
"message": "Invalid Key"
}Copy link Fetch Product
Fetch a previously created product
Path Parameters
The unique identifier of the product
Response
200Product Fetch response
33 object properties
3 object properties
1 object property
GET
/product/{id}curl https://api.paystack.co/product/2196244 \
-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.product.fetch("2196244");
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.product.fetch("2196244")
puts response.dataResponse
{
"status": true,
"message": "Product retrieved",
"data": {
"digital_assets": [],
"integration": 463433,
"name": "Mimshack",
"description": "Everything cars",
"product_code": "PROD_22deobcvbht2dfe",
"price": 50000,
"currency": "NGN",
"quantity": 10,
"quantity_sold": null,
"type": "good",
"files": null,
"file_path": null,
"is_shippable": true,
"shipping_fields": {
"delivery_note": "disabled"
},
"unlimited": false,
"domain": "test",
"active": true,
"features": null,
"in_stock": true,
"metadata": {
"background_color": "#F5F5F5"
},
"slug": "mimshack-yiuedh",
"success_message": null,
"redirect_url": null,
"split_code": null,
"notification_emails": null,
"minimum_orderable": 1,
"maximum_orderable": null,
"low_stock_alert": false,
"stock_threshold": null,
"expires_in": null,
"id": 795638,
"createdAt": "2022-04-12T11:21:43.000Z",
"updatedAt": "2022-04-12T11:21:43.000Z"
}
}{
"status": false,
"message": "An error occurred",
"meta": {
"nextStep": "string"
},
"type": "string",
"code": "validation_error",
"errorCodeMappingNotFound": true
}{
"status": false,
"message": "Product not found"
}Copy link Update product
Update a previously created product
Path Parameters
The unique identifier of the product
Request Body
Name of product
The description of the product
Price should be in kobo if currency is NGN, pesewas, if currency is GHS,
and cents, if currency is ZAR
Currency in which price is set. Allowed values are: NGN, GHS, ZAR or USD
Set to true if the product has unlimited stock. Leave as false if the
product has limited stock
Number of products in stock. Use if limited is true
The split code if sharing the transaction with partners
JSON object of custom data
Response
200Product Update response
32 object properties
3 object properties
1 object property
PUT
/product/{id}curl https://api.paystack.co/product/2196244 \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Spoon",
"description": "Environment friendly paper spoons"
}' \
-X PUTimport { Paystack } from "@paystack/paystack-sdk";
const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });
const response = await paystack.product.update("2196244", {
name: "Spoon",
description: "Environment friendly paper spoons"
});
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.product.update("2196244", {
name: "Spoon",
description: "Environment friendly paper spoons"
})
puts response.dataResponse
{
"status": true,
"message": "Product successfully updated",
"data": {
"name": "Prod One",
"description": "Prod 1",
"product_code": "PROD_ohc0xq1ajpt2271",
"price": 20000,
"currency": "NGN",
"quantity": 5,
"quantity_sold": null,
"type": "good",
"image_path": "",
"file_path": "",
"is_shippable": false,
"unlimited": false,
"domain": "test",
"active": true,
"features": null,
"in_stock": true,
"metadata": null,
"id": 526,
"integration": 343288,
"createdAt": "2019-06-29T14:46:52.000Z",
"updatedAt": "2019-06-29T15:29:21.000Z"
}
}{
"status": false,
"message": "Invalid Key"
}{
"status": false,
"message": "An error occurred",
"meta": {
"nextStep": "string"
},
"type": "string",
"code": "validation_error",
"errorCodeMappingNotFound": true
}Copy link Delete Product
Delete a previously created product
Path Parameters
The unique identifier of the product
Response
200Product Delete response
DELETE
/product/{id}curl https://api.paystack.co/product/2196244 \
-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.product.delete("2196244");
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.product.delete_("2196244")
puts response.dataResponse
{
"status": true,
"message": "Request successful"
}{
"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
}