Api Reference
One-off Products
On this page, we'll dive into the different one-off product endpoints you can use to query your products programmatically.
A one-off product is a digital product that can be bought once. Products are configured in the Vatly dashboard and can be added to checkouts.
Looking for subscription plans? See the Subscription Plans API instead.
The one-off product model
Below you'll find all properties for the Vatly One-off Product API resource.
Properties
| Name | Type | Description |
|---|---|---|
id | string | Unique identifier for the product (starts with prod_). |
resource | string | The resource type. Always one_off_product. |
testmode | boolean | Whether this product is in test mode. |
name | string | Display name of the product. |
description | string | Detailed description of the product. |
basePrice | Money | Default price of the product. A Money object with value (decimal string) and currency (ISO 4217 code). Can be overridden in checkout. |
status | string | Current status of the product. Can be approved (active and can be purchased), draft (not yet available), or archived (has been archived). |
createdAt | string | When this product was created (ISO 8601 format). |
links | object | HATEOAS links to related resources. Contains self link. |
List all one-off products
GET /v1/one-off-products
This endpoint retrieves a paginated list of all one-off products.
Optional parameters
| Name | Type | Description |
|---|---|---|
limit | integer | The number of products to return (default: 10, max: 100). |
startingAfter | string | A cursor for use in pagination. Returns results after this product ID. |
endingBefore | string | A cursor for use in pagination. Returns results before this product ID. |
curl -G https://api.vatly.com/v1/one-off-products \
-H "Authorization: Bearer live_your_api_key_here" \
-d limit=10
$vatly = new \Vatly\API\VatlyApiClient();
$vatly->setApiKey('live_your_api_key_here');
$products = $vatly->oneOffProducts->page();
{
"data": [
{
"id": "prod_abc123def456",
"resource": "one_off_product",
"testmode": false,
"name": "Premium License",
"description": "Lifetime access to all premium features",
"basePrice": {
"value": "99.99",
"currency": "EUR"
},
"status": "approved",
"createdAt": "2024-01-15T10:30:00Z",
"links": {
"self": {
"href": "https://api.vatly.com/v1/one-off-products/prod_abc123def456",
"type": "application/json"
}
}
}
],
"links": {
"self": {
"href": "https://api.vatly.com/v1/one-off-products?limit=10",
"type": "application/json"
},
"next": null,
"prev": null
},
"count": 1
}
Get a specific one-off product
GET /v1/one-off-products/:id
This endpoint retrieves a specific one-off product by its ID.
Parameters
| Name | Type | Description |
|---|---|---|
id | string | The ID of the one-off product to retrieve. |
curl https://api.vatly.com/v1/one-off-products/prod_abc123def456 \
-H "Authorization: Bearer live_your_api_key_here"
$vatly = new \Vatly\API\VatlyApiClient();
$vatly->setApiKey('live_your_api_key_here');
$product = $vatly->oneOffProducts->get('prod_abc123def456');
{
"id": "prod_abc123def456",
"resource": "one_off_product",
"testmode": false,
"name": "Premium License",
"description": "Lifetime access to all premium features",
"basePrice": {
"value": "99.99",
"currency": "EUR"
},
"status": "approved",
"createdAt": "2024-01-15T10:30:00Z",
"links": {
"self": {
"href": "https://api.vatly.com/v1/one-off-products/prod_abc123def456",
"type": "application/json"
}
}
}