Self-service change del plan transactional (modelo Stripe-style)
POST
/v1/client/subscriptions/change-plan
const url = 'https://api.mailerdash.com/v1/client/subscriptions/change-plan';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"package_id":"example","password":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.mailerdash.com/v1/client/subscriptions/change-plan \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "package_id": "example", "password": "example" }'Cliente cambia su plan transactional (billing_model=‘sends’). Upgrade aplica inmediato — recibe beneficios HOY, cobra proporcional de días restantes del ciclo al precio nuevo (persistido en prorated_charges para invoice manual / Stripe futuro). Downgrade scheduled — sub.pending_package_id set hasta nextBillingReset, cliente mantiene beneficios sin refund. Re-auth password.
Authorizations
Sección titulada «Authorizations »Request Body required
Sección titulada «Request Body required » Media type application/json
object
package_id
required
Package destino (billing_model=sends). legacy bloqueado.
string
password
required
string
Example generated
{ "package_id": "example", "password": "example"}Responses
Sección titulada « Responses »Cambio aplicado o scheduled
Media type application/json
object
sub_id
string
type
string
proration
Solo upgrade
object
amount_usd_cents
integer
days_charged
integer
cycle_days
integer
effective_at
Solo downgrade
string format: date-time
Example
{ "type": "upgrade"}Same_package | package_not_selectable | otro validation error
Password incorrecto
Error interno