curl --request POST \
--url https://api.example.com/plans/{planId}/intervals \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"interval": "<string>",
"amount": 123,
"currency": "<string>"
}
'{
"planIntervalId": "019525fd-7e40-7c5a-b2d8-4e6f8a0c2e4a",
"planId": "019525fd-6b2c-7a1e-9d4f-3c5e7a9b1d3f",
"externalRef": "price_stripe_y8",
"interval": "YEARLY",
"amount": 47040,
"currency": "BRL",
"status": "ACTIVE",
"createdBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"createdAt": "2026-03-25T14:00:00.000Z",
"updatedBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"updatedAt": "2026-03-25T14:00:00.000Z"
}
Adicionar um novo intervalo de billing (mensal ou anual) a um plano existente.
curl --request POST \
--url https://api.example.com/plans/{planId}/intervals \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"interval": "<string>",
"amount": 123,
"currency": "<string>"
}
'{
"planIntervalId": "019525fd-7e40-7c5a-b2d8-4e6f8a0c2e4a",
"planId": "019525fd-6b2c-7a1e-9d4f-3c5e7a9b1d3f",
"externalRef": "price_stripe_y8",
"interval": "YEARLY",
"amount": 47040,
"currency": "BRL",
"status": "ACTIVE",
"createdBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"createdAt": "2026-03-25T14:00:00.000Z",
"updatedBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"updatedAt": "2026-03-25T14:00:00.000Z"
}
plan_interval:write.MONTHLY, YEARLY.USD, BRL, EUR.{
"planIntervalId": "019525fd-7e40-7c5a-b2d8-4e6f8a0c2e4a",
"planId": "019525fd-6b2c-7a1e-9d4f-3c5e7a9b1d3f",
"externalRef": "price_stripe_y8",
"interval": "YEARLY",
"amount": 47040,
"currency": "BRL",
"status": "ACTIVE",
"createdBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"createdAt": "2026-03-25T14:00:00.000Z",
"updatedBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"updatedAt": "2026-03-25T14:00:00.000Z"
}
curl -X POST https://api.awsales.io/admin/plans/019525fd-6b2c-7a1e-9d4f-3c5e7a9b1d3f/intervals \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"interval": "YEARLY",
"amount": 29990,
"currency": "BRL"
}'
| Status | Codigo | Descricao |
|---|---|---|
400 | validation_error | Entrada invalida ou campos obrigatorios ausentes |
401 | unauthorized | Autenticacao ausente ou invalida |
403 | forbidden | Permissoes insuficientes |
409 | plan_interval.interval_already_exists | Intervalo do plano ja existe para esta frequencia |
422 | plan_interval.currency_not_compatible | Moeda nao e compativel com o plano |
500 | internal_server_error | Ocorreu um erro inesperado |