PGecom
  • 🚀Introduction
  • đŸŽ¯Guides
    • Getting authenticated
  • 📚Concepts
    • Sandbox Environment
  • 🧑‍đŸ’ģAPI Endpoint
    • Ecommerce
      • đŸ›ī¸Shop
        • GetShopById
        • CreateShop
      • 👔Product
        • ProductSchema
        • GetProductById
        • GetProductBySlug
        • CreateNewProduct
      • 🛒Checkout
        • CreateCheckoutSession
      • Form
        • GetFormById
      • Invoice
        • GetInvoiceById
    • Wordpress Plugin
    • Chrome Extension
    • GiftCards
      • â„šī¸Gift Card Schema
      • ✅List giftcards
      • â˜‘ī¸Order a gift card
      • â˜‘ī¸Get giftcard
      • â˜‘ī¸Rates
    • Send rewards
      • â„šī¸Rewards Schema
      • â˜‘ī¸Send rewards
    • Withdraw
      • â„šī¸Withdraw Schema
      • â˜‘ī¸Process Withdraw
      • â˜‘ī¸Rates
    • Radar
      • â„šī¸Radar Schema
      • â˜‘ī¸Check for Fraudster
    • Top Up
      • â„šī¸Topup Schema
      • â˜‘ī¸Estimate
      • â˜‘ī¸Send
    • Payment
      • Mon Cash
        • CreateMonCashPayment
        • VerifyMonCashPayment
        • WithdrawToMonCashEstimate
        • WithdrawFundsToMonCash
      • PG Pay
        • ConfigurePGPay
        • CreatePGPayPayment
        • VerifyPGPaymentWithToken
        • VerifyPGPaymentWithOrderId
    • Deprecated
      • Card Holder
        • â„šī¸Card Holder Schema
        • â˜‘ī¸Update
      • Card
        • â„šī¸Card Schema
        • ✅Retrieve a single card
        • ✅List cards
        • â˜‘ī¸Create a card
        • â˜‘ī¸Create Customer
  • 🎓Resources
    • Support
    • Production Access
Powered by GitBook
On this page

Was this helpful?

  1. API Endpoint
  2. Ecommerce
  3. Category

GetCategoryBySlug

This endpoint is there to get category by slug

You'll need to replace the {{slugName}} with the actual category to fetch the API

GET https://sandbox.pgecom.com/api/v1/category/slug/{{slugName}}

[
    {
        "href": "/shoes",
        "shopId": "0a40d129-0728-4b10-b32e-117abd6938c3",
        "updatedAt": "2023-11-22T22:55:37Z",
        "slug": "shoes",
        "menuItemId": "db123901-5646-4061-88d8-bfcb83df21aa",
        "createdAt": "2023-11-22T22:55:37Z",
        "productIds": [],
        "id": "acdc3018-1fb9-4127-9097-f1b8270d87d5",
        "title": "Shoes"
    }
]
{
    "message": "Too many requests, please try again later.",
    "status": 429
}
const axios = require('axios');

let config = {
  method: 'get',
  url: 'https://sandbox.pgecom.com/api/v1/storefront/category/slug/shoes?shopId=0a40d129-0728-4b10-b32e-117abd6938c3',
  headers: { }
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
import requests

url = "https://sandbox.pgecom.com/api/v1/storefront/category/slug/shoes?shopId=0a40d129-0728-4b10-b32e-117abd6938c3"

payload = {}
headers = {}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://sandbox.pgecom.com/api/v1/storefront/category/slug/shoes?shopId=0a40d129-0728-4b10-b32e-117abd6938c3")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://sandbox.pgecom.com/api/v1/storefront/category/slug/shoes?shopId=0a40d129-0728-4b10-b32e-117abd6938c3');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
curl --location 'https://sandbox.pgecom.com/api/v1/storefront/category/slug/shoes?shopId=0a40d129-0728-4b10-b32e-117abd6938c3

Last updated 6 months ago

Was this helpful?

🧑‍đŸ’ģ
📸