Saltar para o conteúdo principal
PATCH
/
public
/
api
/
v1
/
billing
/
plans
/
{planPublicId}
Update plan
curl --request PATCH \
  --url https://api.gennia.ai/public/api/v1/billing/plans/{planPublicId} \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "content": {
    "agents": [
      {
        "agentPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      }
    ],
    "externalLinkPublicIds": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ],
    "pages": [],
    "sectionOrdering": [
      {
        "displayOrder": 123
      }
    ]
  },
  "creditPackagePublicId": "1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d",
  "description": "Best for growing teams.",
  "extraCreditsEnabled": true,
  "extraCreditsPriceCents": 500,
  "name": "Pro",
  "packagePublicId": "9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21",
  "priceCents": 4990,
  "seatsIncluded": 5,
  "unlimitedCredits": false,
  "widgetCtaText": "Get started",
  "widgetDescription": "Best for growing teams.",
  "widgetFeatures": [
    {
      "included": true,
      "text": "<string>"
    }
  ],
  "widgetHighlighted": true,
  "widgetTitle": "Pro"
}
'
{
  "activeSubscriptions": 123,
  "billingIntervalMonths": 123,
  "checkoutUrl": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "creditPackage": {
    "creditValueCents": 123,
    "creditsAmount": 123,
    "extraCreditsAmount": 123,
    "name": "<string>",
    "publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "renewalIntervalMonths": 123
  },
  "currency": "<string>",
  "description": "<string>",
  "extraCreditsEnabled": true,
  "extraCreditsPriceCents": 123,
  "formattedPrice": "<string>",
  "hubPackage": {
    "name": "<string>",
    "publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  },
  "name": "<string>",
  "priceCents": 123,
  "publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "seatsIncluded": 123,
  "unlimitedCredits": true,
  "visible": true,
  "widgetCtaText": "<string>",
  "widgetDescription": "<string>",
  "widgetFeatures": [
    {
      "included": true,
      "text": "<string>"
    }
  ],
  "widgetHighlighted": true,
  "widgetTitle": "<string>"
}

Autorizações

X-Api-Key
string
header
obrigatório

Parâmetros de caminho

planPublicId
string<uuid>
obrigatório

Corpo

application/json

Body for updating an existing plan. All fields are optional. Immutable fields (currency, billingType, billingIntervalMonths) require delete+recreate due to Stripe constraints.

content
object

Inline plan content definition. Mutually exclusive with packagePublicId.

creditPackagePublicId
string<uuid>

Public ID of the credit package bundled with the plan.

Exemplo:

"1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d"

description
string

New short description of the plan.

Maximum string length: 500
Exemplo:

"Best for growing teams."

extraCreditsEnabled
boolean

Whether customers can purchase extra credits beyond the included amount.

Exemplo:

true

extraCreditsPriceCents
integer<int32>

Price of an extra credit pack in the smallest currency unit (cents).

Intervalo necessário: x >= 1
Exemplo:

500

name
string

New display name of the plan.

Required string length: 3 - 100
Exemplo:

"Pro"

packagePublicId
string<uuid>

Public ID of the agent/feature package backing this plan. Mutually exclusive with content.

Exemplo:

"9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21"

priceCents
integer<int32>

New plan price in the smallest currency unit (cents).

Intervalo necessário: x >= 0
Exemplo:

4990

seatsIncluded
integer<int32>

Number of workspace seats included in the plan.

Intervalo necessário: x >= 1
Exemplo:

5

status
enum<string>

New plan lifecycle status.

Opções disponíveis:
active,
inactive
unlimitedCredits
boolean

Whether the plan offers unlimited credits (overrides the credit package).

Exemplo:

false

widgetCtaText
string

Call-to-action text on the plan widget.

Maximum string length: 30
Exemplo:

"Get started"

widgetDescription
string

Short description shown on the plan widget.

Maximum string length: 100
Exemplo:

"Best for growing teams."

widgetFeatures
object[]

Bullet-point features shown on the plan widget.

widgetHighlighted
boolean

Whether to visually highlight this plan in the pricing widget.

Exemplo:

true

widgetTitle
string

Title shown on the plan widget.

Maximum string length: 50
Exemplo:

"Pro"

Resposta

OK

activeSubscriptions
integer<int32>
billingIntervalMonths
integer<int32>
billingType
enum<string>
Opções disponíveis:
one_time,
recurring
checkoutUrl
string
createdAt
string<date-time>
creditPackage
object
currency
string
description
string
extraCreditsEnabled
boolean
extraCreditsPriceCents
integer<int32>
formattedPrice
string
hubPackage
object
name
string
priceCents
integer<int32>
publicId
string<uuid>
seatsIncluded
integer<int32>
status
enum<string>
Opções disponíveis:
active,
inactive
unlimitedCredits
boolean
visible
boolean
widgetCtaText
string
widgetDescription
string
widgetFeatures
object[]
widgetHighlighted
boolean
widgetTitle
string