Products
Define what customers pay for. A product belongs to a wallet and has a price.
The product object
idstringoptional | Unique identifier. |
namestringoptional | Display name. |
descriptionstring | nulloptional | Optional description. |
imageUrlstring | nulloptional | Optional image URL. |
assetCodestringoptional | Asset code, e.g. XLM or USDC. |
assetIssuerstring | nulloptional | Issuer for non-native assets. |
priceType"FIXED" | "CUSTOM"optional | Fixed price or customer-chosen. |
pricestring | nulloptional | Price for fixed-price products. |
minAmountstring | nulloptional | Minimum for custom products. |
activebooleanoptional | Inactive products reject payments. |
walletobjectoptional | The receiving wallet (id, name, address, network). |
paymentLinkCountnumberoptional | Number of payment links. |
createdAtstringoptional | ISO 8601 timestamp. |
Create a product
POST
/api/v1/productsnamestringrequired | Display name. |
walletIdstringrequired | A monitored wallet you own. |
assetCodestringrequired | Use XLM or a custom code. |
priceType"FIXED" | "CUSTOM"required | Pricing model. |
pricestringoptional | Required when priceType is FIXED. |
minAmountstringoptional | Optional minimum for CUSTOM. |
assetIssuerstringoptional | Required for non-XLM assets. |
descriptionstringoptional | Optional. |
imageUrlstringoptional | Optional image URL. |
activebooleanoptional | Defaults to true. |
curl https://your-app.com/api/v1/products \ -H "Authorization: Bearer $STELLARHOOKS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Pro plan", "walletId": "WALLET_ID", "assetCode": "XLM", "priceType": "FIXED", "price": "25" }'Returns the created product:
json
{ "data": { "id": "prod_123", "name": "Pro plan", "description": null, "imageUrl": null, "assetCode": "XLM", "assetIssuer": null, "priceType": "FIXED", "price": "25", "minAmount": null, "active": true, "wallet": { "id": "wal_123", "name": "Treasury", "address": "G...", "network": "TESTNET" }, "paymentLinkCount": 0, "createdAt": "2026-01-01T00:00:00.000Z" }, "error": null}List products
GET
/api/v1/productspagenumberoptional | Page number (default 1). |
pageSizenumberoptional | Items per page (max 100). |
activebooleanoptional | Filter by active state. |
searchstringoptional | Filter by name. |
sortBy"createdAt" | "name"optional | Sort field. |
sortOrder"asc" | "desc"optional | Sort direction. |
bash
curl "https://your-app.com/api/v1/products?active=true&sortBy=name&page=1" \ -H "Authorization: Bearer $STELLARHOOKS_API_KEY"Returns { data: Product[], meta: { page, pageSize, total, totalPages } }.
Retrieve, update, delete
GET
/api/v1/products/{id}PATCH
/api/v1/products/{id}DELETE
/api/v1/products/{id}PATCH accepts the same fields as create (all optional). DELETE removes a product and its links — products with payment history cannot be deleted; deactivate them instead.
bash
curl -X PATCH https://your-app.com/api/v1/products/PRODUCT_ID \ -H "Authorization: Bearer $STELLARHOOKS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "active": false }'