Update a product
Changed onUpdate a product. Only supplied fields change; a price change mints a new default price.
Request
- Base URLhttps://api.creem.io
- AuthAPI key in header x-api-key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
The product ID
Request body
Example request
{
"trial_period_days": 7,
"trial_price": 100,
"usage_prices": [
{
"id": "price_abc123",
"meter_id": "mtr_abc123",
"unit_price": 0.002,
"free_allowance": 1000,
"cap": 50000,
"target_account_name": "images"
}
],
"features": [
{
"id": "feat_abc123",
"description": "500 image credits",
"customer_credits": {
"amount": "100",
"unit_label": "tokens",
"bucket_name": "images"
}
}
]
}Response
Successfully updated the product
Example response
{
"description": "This is a sample product description.",
"image_url": "https://example.com/image.jpg",
"image_urls": [
"https://example.com/image.jpg"
],
"features": [
{
"id": "feat_abc123",
"description": "Access to premium course materials.",
"customer_credits": {
"amount": "100",
"unit_label": "tokens",
"bucket_name": "images"
}
}
],
"usage_prices": [
{
"id": "price_abc123",
"meter_id": "mtr_abc123",
"unit_price": 0.002,
"free_allowance": 1000,
"cap": 50000,
"target_account_name": "images"
}
],
"price": 400,
"currency": "USD",
"recurring_interval": "month",
"recurring_interval_count": 3,
"trial_period_days": 7,
"trial_price": 100,
"product_url": "https://creem.io/product/prod_123123123123",
"default_success_url": "https://example.com/?status=successful",
"created_at": "2023-01-01T00:00:00Z",
"updated_at": "2023-01-01T00:00:00Z"
}Changes
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the optional property
to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status
- info
- breaking
the
response's property type changed fromobjecttostringfor status - breaking
the
response's property type changed fromobjecttointegerfor status
- breaking