Skip to main content
POST
/
v1
/
products
Create a product
curl --request POST \
  --url https://api.yuvexpay.com/v1/products \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Idempotency-Key: <x-idempotency-key>' \
  --data '
{
  "name": "Premium Plan",
  "description": "Monthly premium subscription",
  "amount": 99.9,
  "externalId": "plan-premium",
  "metadata": {
    "tier": "premium",
    "billing": "monthly"
  }
}
'
{
  "product": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "description": "<string>",
    "amount": 123,
    "externalId": "<string>",
    "isActive": true,
    "createdAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

API access token obtained from POST /oauth/token. Include as Authorization: Bearer {token}.

Headers

X-Idempotency-Key
string
required

A unique string to ensure the request is processed only once. Must be unique per request. Valid for 24 hours.

Maximum string length: 100

Body

application/json
name
string
required

Product name.

Required string length: 1 - 200
externalId
string

Your own product ID.

Maximum string length: 100
description
string

Product description.

Maximum string length: 1000
amount
number

Default price.

Required range: 0.01 <= x <= 1000000
metadata
object

Response

Product created.

product
object