Skip to content

Complete an upgrade after the SDK confirmed its payment intent

POST
/v1/billing/plan-change/sync
curl --request POST \
--url https://api.emite.cr/v1/billing/plan-change/sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "paymentIntentId": "example" }'

For a checkout answer of POST /billing/plan-change with paymentType='one_time'. Reads the intent back from Onvo (the payload is never trusted for the grant); once it is succeeded, creates the subscription that renews the plan with a trial of the days paid, makes the plan effective and retires the one it replaces. Idempotent per intent, and the same completion the payment-intent.succeeded webhook and the reconcile run — so a lost call never leaves money in and no plan out. Answers the intent's live status while it is not succeeded (an asynchronous method still settling), active once the plan is on, and processing while a concurrent completion of the same intent is still running. 400 PLAN_UPGRADE_NEEDS_REVIEW when the money is in but a human has to finish the change.

Media typeapplication/json
object
paymentIntentId
required

The payment intent of the upgrade the SDK just confirmed — paymentIntentId of the checkout answer of POST /billing/plan-change whose paymentType is one_time.

string
Examplegenerated
{
"paymentIntentId": "example"
}
Media typeapplication/json
object
status
required

Reconciled subscription status after the SDK confirmed payment.

string
Examplegenerated
{
"status": "example"
}