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 one_off_product_). |
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 active (product is active and can be purchased), pending (awaiting approval), or rejected (has been rejected). |
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.
Only products with active status can be used in checkouts.
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": "one_off_product_Vr8kQdFhSrG4Y3DnfsdqH",
"resource": "one_off_product",
"testmode": false,
"name": "Premium License",
"description": "Lifetime access to all premium features",
"basePrice": {
"value": "299.00",
"currency": "EUR"
},
"status": "active",
"createdAt": "2024-01-15T10:30:00Z",
"links": {
"self": {
"href": "https://api.vatly.com/v1/one-off-products/one_off_product_Vr8kQdFhSrG4Y3DnfsdqH",
"type": "application/json"
}
}
}
],
"count": 1,
"links": {
"self": {
"href": "https://api.vatly.com/v1/one-off-products",
"type": "application/json"
},
"next": null,
"prev": null
}
}
Get a specific one-off product
GET /v1/one-off-products/:oneOffProductId
This endpoint retrieves a specific one-off product by its ID.
Parameters
| Name | Type | Description |
|---|---|---|
oneOffProductId | string | The ID of the one-off product to retrieve. |
curl https://api.vatly.com/v1/one-off-products/one_off_product_Vr8kQdFhSrG4Y3DnfsdqH \
-H "Authorization: Bearer live_your_api_key_here"
$vatly = new \Vatly\API\VatlyApiClient();
$vatly->setApiKey('live_your_api_key_here');
$product = $vatly->oneOffProducts->get('one_off_product_Vr8kQdFhSrG4Y3DnfsdqH');
{
"id": "one_off_product_Vr8kQdFhSrG4Y3DnfsdqH",
"resource": "one_off_product",
"testmode": false,
"name": "Premium License",
"description": "Lifetime access to all premium features",
"basePrice": {
"value": "299.00",
"currency": "EUR"
},
"status": "active",
"createdAt": "2024-01-15T10:30:00Z",
"links": {
"self": {
"href": "https://api.vatly.com/v1/one-off-products/one_off_product_Vr8kQdFhSrG4Y3DnfsdqH",
"type": "application/json"
}
}
}