This guide provides detailed instructions for using the Grouptify Product Group API to manage product groups in your e-commerce platform. The API allows you to create, retrieve, update, and delete product groups, with support for customizable options and Shopify integration. This document is tailored for advanced users who have obtained their API key from the Grouptify settings panel.
To use the API, you need an API key, which can be found in your Shopify admin:
Important: Keep your API key secure and do not expose it publicly.
For technical support or questions about the API, contact us at: support@tapita.io
All API requests require the following header for authentication:
Headers: {
"gtf-api-key": "YOUR_API_KEY"
}
https://grouptify.pwa-commerce.com/
A product group is represented as a JSON object with the following structure. Note that identifiers (id fields) must be unique across the system to prevent conflicts.
{
"_id": "64f9a12c456b789d0e123a45",
"id": "group1",
"name": "Summer Collection",
"is_active": true,
"options": [
{
"id": "option1",
"name": "Color",
"template_card": "mpg-swatch-circle",
"template_prod": "mpg-swatch-circle",
"values": [
{
"id": "color1",
"name": "Red",
"style": "color1",
"color1": "#FF0000",
"color2": "",
"image_custom": ""
},
{
"id": "color2",
"name": "Custom Image",
"style": "custom_image",
"color1": "",
"color2": "",
"image_custom": "https://example.com/images/custom.jpg"
}
]
}
],
"products": [
{
"id": "14676221886832",
"title": "Red Summer Shirt",
"handle": "red-summer-shirt",
"status": "ACTIVE",
"images": ["https://example.com/images/shirt.jpg"],
"options": ["color1"],
"regular_price": 100,
"sale_price": 80,
"available": true
}
]
}
group1). Must be distinct across all groups to avoid conflicts.true) or unpublished (false).option1).mpg-buttonmpg-button-pillmpg-dropdownmpg-swatch-circlempg-swatch-squarempg-swatch-polaroidmpg-swatch-circle-buttonmpg-swatch-square-buttonmpg-swatch-image-buttontemplate_card).color1).color1: Single-color swatch.color2: Two-color swatch.custom_image: Custom image swatch.color1 or color2 styles (e.g., #FF0000).color2 style.custom_image style."14824372961648". You can find this ID in your Shopify admin URL when viewing a product: https://admin.shopify.com/store/your-store-name/products/14824372961648ACTIVE, DRAFT).options.values) associated with the product.Note on Unique IDs: All IDs must be unique across the system. Use simple, meaningful identifiers that help you understand the relationship between elements (e.g., group1, option1, color1, product1).
Retrieve a paginated list of product groups with optional filtering.
Method: GET
URL: /grouptify
Permission: read_product_group
Query Parameters:
page (integer, optional, default: 1): Page number for pagination.page_size (integer, optional, default: 10): Number of items per page.query (string, optional): Filter groups by name, product title, or product handle.create_method (string, optional): Filter by creation method (manual, automation, all; default: all).Response:
Example Request:
GET https://grouptify.pwa-commerce.com/grouptify?page=1&page_size=10&query=shirt&create_method=manual HTTP/1.1
Headers:
gtf-api-key: YOUR_API_KEY
Example Response:
{
"results": [
{
"_id": "64f9a12c456b789d0e123a45",
"id": "group1",
"name": "Shirt Collection",
"is_active": true,
"options": [...],
"products": [...]
}
],
"total": 25,
"page": 1,
"page_size": 10,
"total_pages": 3
}
Retrieve a single product group by its unique MongoDB ID.
Method: GET
URL: /grouptify/:id
Permission: read_product_group
URL Parameters:
id (string, required): The MongoDB _id of the product group (e.g., 64f9a12c456b789d0e123a45).Response:
Example Request:
GET https://grouptify.pwa-commerce.com/grouptify/64f9a12c456b789d0e123a45 HTTP/1.1
Headers:
gtf-api-key: YOUR_API_KEY
Example Response:
{
"_id": "64f9a12c456b789d0e123a45",
"id": "group1",
"name": "Shirt Collection",
"is_active": true,
"options": [...],
"products": [...]
}
Create a new product group. The system will automatically generate a unique _id for the group.
Method: POST
URL: /grouptify
Permission: write_product_group
Body: JSON object matching the product group structure (excluding _id and shop, which are determined by the system and your API key respectively).
Response:
_id.Example Request:
POST https://grouptify.pwa-commerce.com/grouptify HTTP/1.1
Headers:
gtf-api-key: YOUR_API_KEY
Content-Type: application/json
{
"id": "summer-collection-2024",
"name": "Summer Collection 2024",
"is_active": true,
"options": [
{
"id": "color-option",
"name": "Color",
"template_card": "mpg-swatch-circle",
"template_prod": "mpg-swatch-circle",
"values": [
{
"id": "red-color",
"name": "Red",
"style": "color1",
"color1": "#FF0000",
"color2": "",
"image_custom": ""
}
]
}
],
"products": [
{
"id": "14824372961648",
"title": "Red Summer Shirt",
"handle": "red-summer-shirt",
"status": "ACTIVE",
"images": ["https://example.com/images/shirt.jpg"],
"options": ["red-color"],
"regular_price": 100,
"sale_price": 80,
"available": true
}
]
}
Example Response:
{
"_id": "64f9a12c456b789d0e123a47",
"id": "summer-collection-2024",
"name": "Summer Collection 2024",
"is_active": true,
"shop": "shop123",
"options": [...],
"products": [...]
}
Update an existing product group by its unique MongoDB ID.
Method: PUT
URL: /grouptify/:id
Permission: write_product_group
URL Parameters:
id (string, required): The MongoDB _id of the product group (e.g., 64f9a12c456b789d0e123a45).Body: JSON object with fields to update (partial updates supported).
Response:
Example Request:
PUT https://grouptify.pwa-commerce.com/grouptify/64f9a12c456b789d0e123a45 HTTP/1.1
Headers:
gtf-api-key: YOUR_API_KEY
Content-Type: application/json
{
"name": "Updated Summer Collection",
"is_active": false
}
Example Response:
{
"_id": "64f9a12c456b789d0e123a45",
"id": "group1",
"name": "Updated Summer Collection",
"is_active": false,
"shop": "shop123",
"options": [...],
"products": [...]
}
Delete a product group by its unique MongoDB ID.
Method: DELETE
URL: /grouptify/:id
Permission: write_product_group
URL Parameters:
id (string, required): The MongoDB _id of the product group (e.g., 64f9a12c456b789d0e123a45).Response:
Example Request:
DELETE https://grouptify.pwa-commerce.com/grouptify/64f9a12c456b789d0e123a45 HTTP/1.1
Headers:
gtf-api-key: YOUR_API_KEY
Example Response:
{
"message": "Deleted successfully"
}
Delete multiple product groups by their unique MongoDB IDs.
Method: POST
URL: /grouptify/bulk-delete
Permission: write_product_group
Body:
{
"ids": [
"64f9a12c456b789d0e123a45",
"64f9a12c456b789d0e123a46"
]
}
Response:
Example Request:
POST https://grouptify.pwa-commerce.com/grouptify/bulk-delete HTTP/1.1
Headers:
gtf-api-key: YOUR_API_KEY
Content-Type: application/json
{
"ids": [
"64f9a12c456b789d0e123a45",
"64f9a12c456b789d0e123a46"
]
}
Example Response:
{
"message": "Deleted successfully"
}
Errors are returned with standard HTTP status codes and a JSON body:
{
"message": "Detailed error message"
}
Common HTTP status codes:
400 Bad Request: Invalid request body or parameters.401 Unauthorized: Missing or invalid API key.403 Forbidden: Insufficient permissions.404 Not Found: Resource not found.500 Internal Server Error: Server-side error._id field value, not the human-readable id field."14824372961648". You can find this in your Shopify admin URL when viewing the product.page and page_size parameters for efficient retrieval of large group lists.template_card and template_prod use valid values including the new mpg-swatch-image-button option.id fields must be unique across the system to prevent conflicts.To ensure optimal performance for all users, the API implements rate limiting. If you exceed the rate limit, you'll receive a 429 Too Many Requests response. In such cases, wait a moment before making additional requests.