API Plugin Documentation
This documentation provides information on how to use the custom API to retrieve product information, including product variations, custom fields and pricing.
Base URL
https://www.oldeani.com/wp-json/store-api/v1/
Authentication
All requests require a valid API key. Include the API key in the query string:
https://www.oldeani.com/wp-json/store-api/v1/products?api_key={YOUR_API_KEY}
Replace {YOUR_API_KEY} with your provided key.
Endpoints
1. Get All Products
Endpoint: /products
Method: GET
Description: Returns a list of products with variations, custom fields, and other product details.
Parameters:
category
(optional): Filter products by category slug.search
(optional): Filter products by a search stringlimit
(optional): Number of products to retrieve (default: all products).
Example Request:
GET /wp-json/store-api/v1/products?api_key={YOUR_API_KEY}&category=eco-range&search=RPET
Example Response:
[
{
"id": 12392,
"name": "Armour RPET laptop bag",
"description": "",
"short_description": "Protect your laptop with the anti-drop collision buffer Armour laptop bag. The outside is manufactured from RPET resulting in fewer bottles going to landfill and less energy being consumed in production. Features front pocket for organising accessories, YKK zip and super soft faux fur lining.\r\n\r\nFits a 16 inch laptop",
"category": [
"Eco-range",
"Laptop bags",
"Bags",
"Travel bags",
"rPet bags"
],
"images": [],
"variations": [
{
"id": 12393,
"attributes": {
"pa_colour": "black",
"pa_branding": "digital-transfer"
},
"image": false,
"variation_price_50": "",
"variation_price_100": "",
"variation_price_250": "",
"variation_price_500": "",
"variation_price_1000": ""
}
],
"carriage_costs": {
"carriage_cost_50": null,
"carriage_cost_100": null,
"carriage_cost_250": null,
"carriage_cost_500": null,
"carriage_cost_1000": null
},
"unit_prices": {
"unit_price_50": null,
"unit_price_100": null,
"unit_price_250": null,
"unit_price_500": null,
"unit_price_1000": null,
"1_colour_print": null,
"2_colour_print": null,
"3_colour_print": null,
"full_colour": null,
"full_colour_uv": null,
"digital_transfer": null,
"laser_engraving": null
},
"product_details": {
"materials": null,
"dimensions": null,
"brand_area": null,
"colours": null,
"packaging_details": null,
"hs_code": null,
"leadtime": null,
"product_links": null
}
},
...
]
3. Get Products by Category
Endpoint: /products
Method: GET
Description: Filter products by category.
Parameters:
category
(required): The slug of the category to filter by.
Example Request:
GET /wp-json/store-api/v1/products?api_key={YOUR_API_KEY}&category=eco-range
4. Get Products by Search
Endpoint: /products
Method: GET
Description: Filter products by a search string.
Parameters:
search
(required): The string to search in product data.
Example Request:
GET /wp-json/store-api/v1/products?api_key={YOUR_API_KEY}&search=RPET
5. Get Categories
Endpoint: /categories
Method: GET
Description: Returns a list of available product categories.
Example Request:
GET /wp-json/store-api/v1/categories?api_key={YOUR_API_KEY}
Example Response:
[
"laptop-bags",
"desk-clocks",
"calculators",
"tritan-bottles-drinkware",
"audio-sound"
]
Errors
Common error responses:
{
"success": false,
"error": "Invalid API Key"
}
{
"success": false,
"error": "Rate limit exceeded"
}