Skip to content

Storefronts ​

Storefront operations.

Use it as client.storefronts. Every method takes keyword arguments, returns a PaystackSdk::Response, and raises a PaystackSdk::Error if a parameter is invalid before anything is sent. An unsuccessful result from Paystack (a 400 or 404) comes back as a Response with success? false.

Methods ​

list ​

ruby
storefronts.list(per_page: nil, page: nil, status: nil)

List Storefronts.

List the storefronts you previously created

ParameterTypeRequiredDescription
per_pageIntegerNumber of records to fetch per request
pageIntegerThe offset to retrieve data from
statusStringOne of: active, inactive.

Paystack docs: https://paystack.com/docs/api/storefront/#list

create ​

ruby
storefronts.create(name:, slug:, currency:, description: nil)

Create Storefront.

Create a digital shop to manage and display your products

ParameterTypeRequiredDescription
nameStringyesName of the storefront
slugStringyesA unique identifier to access your store.
currencyStringyesCurrency for prices of products in your storefront. One of: GHS, KES, NGN, USD, ZAR.
descriptionStringThe description of the storefront

Paystack docs: https://paystack.com/docs/api/storefront/#create

fetch ​

ruby
storefronts.fetch(id:)

Fetch Storefront.

Get the details of a previously created Storefront

ParameterTypeRequiredDescription
idIntegeryesThe unique identifier of the Storefront

Paystack docs: https://paystack.com/docs/api/storefront/#fetch

update ​

ruby
storefronts.update(id:, name: nil, slug: nil, description: nil)

Update Storefront.

Update the details of a previously created Storefront

ParameterTypeRequiredDescription
idIntegeryesThe unique identifier of the Storefront
nameStringName of the storefront
slugStringA unique identifier to access your store.
descriptionStringThe description of the storefront

Paystack docs: https://paystack.com/docs/api/storefront/#update

delete ​

ruby
storefronts.delete(id:)

Delete Storefront.

Delete a previously created Storefront

ParameterTypeRequiredDescription
idIntegeryesThe unique identifier of the Storefront

Paystack docs: https://paystack.com/docs/api/storefront/#delete

verify_slug ​

ruby
storefronts.verify_slug(slug:)

Verify Storefront Slug.

Verify the availability of a slug before using it for your Storefront

ParameterTypeRequiredDescription
slugStringyesThe custom slug to check

Paystack docs: https://paystack.com/docs/api/storefront/#verify-slug

fetch_orders ​

ruby
storefronts.fetch_orders(id:)

Fetch Storefront Orders.

Fetch all orders in your Storefront

ParameterTypeRequiredDescription
idIntegeryesThe unique identifier of the Storefront

Paystack docs: https://paystack.com/docs/api/storefront/#fetch-orders

list_products ​

ruby
storefronts.list_products(id:)

List Storefront Products.

List the products in a Storefront

ParameterTypeRequiredDescription
idIntegeryesThe unique identifier of the Storefront

Paystack docs: https://paystack.com/docs/api/storefront/#list-products

add_products ​

ruby
storefronts.add_products(id:, products:)

Add Products to Storefront.

Add previously created products to a Storefront

ParameterTypeRequiredDescription
idIntegeryesThe unique identifier of the Storefront
productsArrayyesAn array of product IDs

Paystack docs: https://paystack.com/docs/api/storefront/#add-products

publish ​

ruby
storefronts.publish(id:)

Publish Storefront.

Make your Storefront publicly available

ParameterTypeRequiredDescription
idIntegeryesThe unique identifier of the Storefront

Note

Publishing copies the storefront and its products into LIVE mode, even when you call it with a test key (sk_test_). The live copy is active, can be found by its slug, and cannot be read or deleted with a test key. Do not call this to try the API out; use duplicate instead.

Paystack docs: https://paystack.com/docs/api/storefront/#publish

duplicate ​

ruby
storefronts.duplicate(id:)

Duplicate Storefront.

Duplicate a previously created Storefront

ParameterTypeRequiredDescription
idIntegeryesThe unique identifier of the Storefront

Paystack docs: https://paystack.com/docs/api/storefront/#duplicate

Unofficial community SDK. Not affiliated with or endorsed by Paystack. · MIT License · rubygems.org/gems/paystack_sdk