VoidhashDocs
DocumentationAPI reference
Dashboard
Essentials
API overview
Authentication
Endpoints
Ad_accounts
Analytics
Api_keys
Auth
Component_dev_sessions
Component_registry
Components
Development
Events
Experiments
Feature_flag_overrides
Feature_flag_targets
Feature_flags
Ingest_policy
Notification_sends
Notifications
Organizations
Payment_provider_configurations
Payment_provider_products
Payment_sources
Paywall_locations
Paywalls
Perks
Persons
Products
Projects
Push_notification_configurations
Schema
Sdk
Users
Webhooks
Analytics
Event capture
List Products
Create Product
Get Product
Update Product
Delete Product
List Product Perks
Attach Product Perk
Detach Product Perk

Create Product

POST
/api/v1/products

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

duration?number||null
name*string
projectId?string|null
slug*string
type*string

Value in

  • "subscription"
  • "one-time"
  • "one-time-consumable"

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/products" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "slug": "string",    "type": "subscription"  }'
{  "duration": 0,  "id": "string",  "name": "string",  "projectId": "string",  "slug": "string",  "type": "subscription"}
{  "_tag": "Api/ProductValidationError",  "message": "string"}
{  "_tag": "Api/AuthenticationError",  "cause": "string",  "message": "string"}
{  "_tag": "Api/ActionForbiddenError",  "message": "string"}
{  "_tag": "Api/ProductSlugAlreadyExistsError",  "slug": "string"}
{  "_tag": "Api/ProductServiceError",  "cause": "string"}
PreviousList ProductsNextGet Product