RevKeenDocs

Create a price

Creates a new price for a product. Supports fixed, pay-what-you-want, and free pricing models.


Related endpoints

  • GET /prices — List prices
  • GET /prices/{id} — Retrieve a price
  • PATCH /prices/{id} — Update a price
  • DELETE /prices/{id} — Archive a price

Common errors

  • 400 invalid_request — malformed payload or failed validation.
  • 401 unauthenticated — missing, malformed, or revoked API key.
  • 404 resource_missing — the referenced resource does not exist or is not visible to your key.

Idempotency

Pass an Idempotency-Key header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see the idempotency guide.

POST
/prices
x-api-key<token>

Your RevKeen API key (powered by Unkey). Get it from Dashboard > Settings > API Keys. Use rk_sandbox_* for test mode and rk_live_* for production.

In: header

Request Body

application/json

Price creation details

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

Stuck on an error response? Ask the RevKeen assistant to explain it.
curl -X POST "https://api.revkeen.com/v2/prices" \
  -H "x-api-key: $REVKEEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "product_id": "00000000-0000-0000-0000-000000000000",
    "currency": "usd",
    "unit_amount": 0,
    "type": "one_time",
    "pricing_model": "fixed",
    "interval": "day",
    "interval_count": 0,
    "trial_period_days": 0,
    "start_rule": "immediate",
    "minimum_amount": 0,
    "maximum_amount": 0,
    "suggested_amount": 0,
    "preset_amounts": [
      0
    ],
    "name": "string",
    "nickname": "string",
    "description": "string",
    "lookup_key": "string",
    "billing_scheme": "per_unit",
    "tiers_mode": "graduated",
    "tiers": [
      {
        "up_to": null,
        "unit_amount_minor": null,
        "flat_amount_minor": null
      }
    ],
    "transform_quantity": {
      "divide_by": 0,
      "round": "up"
    },
    "percentage_rate_bps": 70,
    "metadata": {}
  }'
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "object": "price",
  "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
  "active": true,
  "currency": "string",
  "unit_amount": 0,
  "unit_amount_decimal": "string",
  "type": "one_time",
  "pricing_model": "fixed",
  "interval": "day",
  "interval_count": 0,
  "trial_period_days": 0,
  "start_rule": "immediate",
  "minimum_amount": 0,
  "maximum_amount": 0,
  "suggested_amount": 0,
  "preset_amounts": [
    0
  ],
  "name": "string",
  "nickname": "string",
  "description": "string",
  "version": 1,
  "lookup_key": "string",
  "billing_scheme": "per_unit",
  "tiers_mode": "graduated",
  "tiers": [
    {
      "up_to": 0,
      "unit_amount_minor": 0,
      "flat_amount_minor": 0
    }
  ],
  "transform_quantity": {
    "divide_by": 0,
    "round": "up"
  },
  "percentage_rate_bps": 0,
  "pay_in_advance": true,
  "spending_minimum_cents": 0,
  "metadata": {},
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string"
  }
}
{
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string"
  }
}
{
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string"
  }
}