Products

Create a product

POST
/v1/products

Authorization

selectkey<token>

API key para requisições autenticadas. Envie sua chave no cabeçalho selectkey (sandbox sk_test_…, produção sk_live_…).

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/products" \  -H "Content-Type: application/json" \  -d '{    "name": "Acme Ltda",    "salesPage": "string",    "description": "string",    "enabled": true,    "type": "physical",    "language": "pt-BR",    "category": "string",    "externalReference": "string",    "warrantyDays": 7,    "images": [      "https://example.com"    ],    "variants": [      {        "name": "Acme Ltda",        "description": "string",        "sku": "string",        "pricing": {          "unitPrice": 5000,          "oldPrice": 5000,          "costPerItem": 0,          "currency": "BRL",          "schema": "unit",          "type": "oneTime",          "daysTrial": 1,          "billingType": "prepaid",          "billingFrequency": "daily",          "billingFrequencyCount": 1,          "billingExactDay": 1,          "cycles": 1,          "trialInterval": "day",          "trialIntervalCount": 1,          "tiersMode": "graduated",          "tiers": [            {              "upTo": 1,              "unitPrice": 5000,              "flatPrice": 5000            }          ],          "transformQuantity": {            "divideBy": 1,            "round": "up"          },          "usageType": "licensed",          "usageAggregation": "sum",          "meterEventName": "string"        },        "images": [          "https://example.com"        ],        "metadata": {},        "attributes": {},        "externalReference": "string",        "enabled": true      }    ]  }'
{
  "id": "prd_0a1b2c3d4e5f60718293",
  "name": "Acme Ltda",
  "slug": "string",
  "salesPage": "string",
  "description": "string",
  "language": "string",
  "enabled": true,
  "salesQty": 0,
  "type": "physical",
  "category": "string",
  "externalReference": "string",
  "warrantyDays": 0,
  "images": [
    "string"
  ],
  "createdAt": "string",
  "updatedAt": "string",
  "variants": [
    {
      "id": "var_0a1b2c3d4e5f60718293",
      "productId": "prd_0a1b2c3d4e5f60718293",
      "name": "Acme Ltda",
      "slug": "string",
      "description": "string",
      "sku": "string",
      "primary": true,
      "enabled": true,
      "pricing": {
        "oldPrice": 5000,
        "unitPrice": 5000,
        "costPerItem": 0,
        "currency": "BRL",
        "schema": "unit",
        "type": "oneTime",
        "daysTrial": 0,
        "billingType": "string",
        "billingFrequency": "string",
        "billingFrequencyCount": 0,
        "billingExactDay": 0,
        "cycles": 0,
        "trialInterval": "string",
        "trialIntervalCount": 0,
        "tiersMode": "string",
        "usageType": "string",
        "usageAggregation": "string",
        "meterEventName": "string"
      },
      "images": [
        "string"
      ],
      "metadata": {},
      "attributes": {},
      "externalReference": "string",
      "checkoutUrl": "string",
      "createdAt": "string",
      "updatedAt": "string"
    }
  ]
}
{
  "error": {
    "status": "Bad Request",
    "statusCode": 400,
    "category": "validation",
    "code": "invalidParameters",
    "message": "Validation errors occurred.",
    "resource": "server"
  }
}
{
  "error": {
    "status": "Unauthorized",
    "statusCode": 401,
    "category": "authentication",
    "code": "unauthorized",
    "message": "Authentication is required to access this resource.",
    "resource": "server"
  }
}
{
  "error": {
    "status": "Forbidden",
    "statusCode": 403,
    "category": "authorization",
    "code": "forbidden",
    "message": "You do not have permission to perform this action.",
    "resource": "server"
  }
}
{
  "error": {
    "status": "Conflict",
    "statusCode": 409,
    "category": "client",
    "code": "idempotencyInProgress",
    "message": "A request with this idempotency key is already being processed.",
    "resource": "server"
  }
}
{
  "error": {
    "status": "Internal Server Error",
    "statusCode": 500,
    "category": "server",
    "code": "serverError",
    "message": "An unexpected error occurred. Please try again later.",
    "resource": "server",
    "details": "If the problem persists, contact support with the correlationId from the response headers."
  }
}