Skip to main content
POST
/
api
/
subscriptions
/
plans
Criar plano
curl --request POST \
  --url https://alpa-sistema-api.onrender.com/api/subscriptions/plans \
  --header 'API-Key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Plano Mensal Premium",
  "amountCents": 9900,
  "interval": "MONTHLY",
  "description": "Acesso completo com suporte prioritário",
  "trialDays": 7,
  "maxSubscribers": 2
}
'
{
  "success": true,
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "Plano Mensal",
    "description": "<string>",
    "amountCents": 9900,
    "interval": "MONTHLY",
    "trialDays": 7,
    "maxSubscribers": 123,
    "active": true,
    "createdAt": "2023-11-07T05:31:56Z"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.usealpa.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

API-Key
string
header
required

Chave de API obtida através do endpoint /api/credentials. Também aceita formato Bearer Token: Authorization: Bearer <api_key>

Body

application/json
name
string
required
Example:

"Plano Mensal Premium"

amountCents
integer
required

Valor em centavos (mínimo R$ 5,00)

Required range: x >= 500
Example:

9900

interval
enum<string>
required
Available options:
MONTHLY,
QUARTERLY,
SEMIANNUAL,
ANNUAL
Example:

"MONTHLY"

description
string
Example:

"Acesso completo com suporte prioritário"

trialDays
integer
Required range: x >= 0
Example:

7

maxSubscribers
integer | null
Required range: x >= 1

Response

Plano criado com sucesso

success
boolean
Example:

true

data
object