Skip to main content

Products

Products API gives you access to read all the products which are active and can be purchased.

Get All Products

This endpoint retrieves all products available for purchase in an institute.

HTTP Request

GET /api/v2.2/products/

Query Parameters

ParameterTypeDescription
categorystringFilters by category name. Ex: IBPS

Fields

NameTypeDescription
idintThe product unique ID
urlstringURL to get details of the product
titlestringTitle of the product
slugstringHuman readable keyword string of the product
imagesarrayAn array of image urls for the product
- original - User uploaded size
- medium - 300x250px
- small - 100x83px
start_datedatestringStart date of product
end_datedatestringEnd date of product
categoriesarrayCategories to which this product belongs
typesarrayType of goods included in this package. Can be E-books, Exams, Classroom Program, Books
pricestringPrice of the product in INR
exams_countintNumber of exams present in this product
notes_countintNumber of documents present in this product
curl --request GET \
--url http://demo.testpress.in/api/v2.2/products/ \
--header 'authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RwcmVzcyIsInVzZXJfaWQiOjE3LCJlbWFpbCI6InRlc3RwcmVzcy5pbkBnbWFpbC5jb20iLCJleHAiOjE0NDc4MzMyMjl9.Ik_yi4lHbNbrRGhqmRpsW82Nls_O9lgXakk_syV-vSw' \
--header 'cache-control: no-cache'

Response

{
"count": 1,
"next": null,
"previous": null,
"per_page": 20,
"results": [
{
"id": 243,
"url": "http://demo.testpress.in/api/v2.2/products/free-ias-prelims-power-pack/",
"title": "Free IAS Prelims Power Pack",
"slug": "free-ias-prelims-power-pack",
"image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/770056a05ab2433191eeeef8de75210f.png",
"images": [
{
"original": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/770056a05ab2433191eeeef8de75210f.png",
"medium": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/bfbfcf2f31f84c5aada30eba2ae6bd2e.png",
"small": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/63b181a83d8c4e198309cacb110bac35.png"
}
],
"start_date": "2.25-01-01T00:00:00+05:30",
"end_date": "2021-12-31T00:00:00+05:30",
"categories": [
"TNPSC"
],
"types": [
"E-books",
"Exams"
],
"exams_count": 1,
"notes_count": 0,
"price": "1.00"
}
]
}

Get Single Product

This endpoint retrieves all products available for purchase in an institute.

HTTP Request

GET /api/v2.2/products/<slug>

URL Parameters

ParameterDescription
slugThe unique slug of the product to retrieve

Fields

NameTypeDescription
descriptionstringBrief description of the product
examsarrayExams present in this product
notesarrayDocuments present in this product
requires_shippingbooleanWhether the product has shippable goods
curl --request GET \
--url http://demo.testpress.in/api/v2.2/products/free-ias-prelims-power-pack/ \
--header 'authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RwcmVzcyIsInVzZXJfaWQiOjE3LCJlbWFpbCI6InRlc3RwcmVzcy5pbkBnbWFpbC5jb20iLCJleHAiOjE0NDc4MzMyMjl9.Ik_yi4lHbNbrRGhqmRpsW82Nls_O9lgXakk_syV-vSw' \
--header 'cache-control: no-cache'

Response

{
"count": 1,
"next": null,
"previous": null,
"per_page": 20,
"results": [
{
"id": 243,
"url": "http://demo.testpress.in/api/v2.2/products/free-ias-prelims-power-pack/",
"title": "Free IAS Prelims Power Pack",
"slug": "free-ias-prelims-power-pack",
"image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/770056a05ab2433191eeeef8de75210f.png",
"images": [
{
"original": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/770056a05ab2433191eeeef8de75210f.png",
"medium": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/bfbfcf2f31f84c5aada30eba2ae6bd2e.png",
"small": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/63b181a83d8c4e198309cacb110bac35.png"
}
],
"start_date": "2.25-01-01T00:00:00+05:30",
"end_date": "2021-12-31T00:00:00+05:30",
"categories": [
"TNPSC"
],
"types": [
"E-books",
"Exams"
],
"exams_count": 1,
"notes_count": 0,
"price": "1.00"
}
]
}