How to get products modified since a date
When synchronizing your catalog with supplier data, you don’t want to fetch all products every time. The getProductDateModified method allows you to retrieve only products that have changed since a specific date, making your sync process much more efficient.
Function getProductDateModified
This endpoint returns a list of product IDs that have been modified since the specified datetime. Use this for incremental catalog updates.
HTTP VERB: GET
URL: https://api.psrestful.com/v2.0.0/suppliers/{SUPPLIER_CODE}/products-modified-since/
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
since | datetime | Yes | ISO 8601 datetime (e.g., 2024-01-15T00:00:00) |
environment | string | No | Environment: PROD or STAGING (default: PROD) |
Example Request
curl -X GET "https://api.psrestful.com/v2.0.0/suppliers/HIT/products-modified-since/?since=2024-12-01T00:00:00" \
-H "X-API-Key: your-api-key"Example Response
COMPLETE URL:
https://api.psrestful.com/v2.0.0/suppliers/HIT/products-modified-since/?since=2024-12-01T00:00:00{
"ProductDateModifiedArray": {
"ProductDateModified": [
{
"productId": "5989"
},
{
"productId": "6234"
},
{
"productId": "7891"
},
{
"productId": "4521"
}
]
},
"ServiceMessageArray": null
}Response Structure
The response contains a ProductDateModifiedArray with ProductDateModified items:
| Field | Description |
|---|---|
productId | The product identifier that has been modified since the specified date |
Typical Workflow
- Initial sync: Fetch all products using sellable-product-ids
- Store last sync time: Record when you last synchronized
- Incremental sync: Use
products-modified-sincewith your last sync time - Update changed products: Fetch full details only for modified products using getProduct
# Example incremental sync workflow
from datetime import datetime, timedelta
# Your last sync timestamp
last_sync = datetime(2024, 12, 1, 0, 0, 0)
# Get modified products
response = requests.get(
f"https://api.psrestful.com/v2.0.0/suppliers/HIT/products-modified-since/",
params={"since": last_sync.isoformat()},
headers={"X-API-Key": "your-api-key"}
)
modified_products = response.json()["ProductDateModifiedArray"]["ProductDateModified"]
# Update only changed products
for product in modified_products:
product_id = product["productId"]
# Fetch and update this product in your catalog
update_product_in_catalog(product_id)
# Update your last sync time
last_sync = datetime.now()Use Cases
- Catalog synchronization: Keep your product catalog in sync without full refreshes
- Price monitoring: Detect products with pricing changes
- Inventory systems: Trigger inventory checks for updated products
- Change detection: Build audit logs of product modifications
API Versions
Both v1.0.0 and v2.0.0 are supported:
https://api.psrestful.com/v1.0.0/suppliers/{SUPPLIER_CODE}/products-modified-since/?since=2024-12-01T00:00:00
https://api.psrestful.com/v2.0.0/suppliers/{SUPPLIER_CODE}/products-modified-since/?since=2024-12-01T00:00:00Best Practices
- Store timestamps: Always store your last successful sync timestamp
- Use reasonable intervals: Don’t query with dates too far in the past; for large date ranges, consider a full sync
- Handle empty responses: If no products have changed, the array will be empty
- Combine with other endpoints: After getting modified IDs, use getProduct for full details
Related Guides
- How to get all sellable products - For initial catalog sync
- How to get product details - Get detailed information for modified products
- How to get closeout products - Find discontinued products