Change plan
PUT
/v1/wallet/plan
const url = 'https://api.orvoca.com/v1/wallet/plan';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"plan":"trial"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.orvoca.com/v1/wallet/plan \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "plan": "trial" }'Upgrades take effect now and are paid from the wallet (402 wallet_empty if it is short). Downgrades and cancellations (trial) take effect on the renewal date; choosing the current plan undoes them.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
plan
required
‘trial’ cancels the paid plan at the renewal date
string
Responses
Section titled “Responses”The wallet after the change
Media typeapplication/json
object
balance
required
object
amount
required
integer
currency
required
string
low_balance
required
Below ₹200
boolean
can_take_calls
required
False when plan minutes and wallet are both used up
boolean
plan
required
object
id
required
string
fee
required
object
amount
required
integer
currency
required
string
included_minutes
required
number
used_minutes
required
number
left_minutes
required
number
extra_minute
required
object
amount
required
integer
currency
required
string
period_start
required
string | null
renews_at
required
string | null
pending_change
required
A downgrade, or ‘trial’ for a cancellation, taking effect on the renewal date
object
plan
required
string
on
required
string
fee_due_since
required
The renewal fee couldn’t be taken; the plan is cancelled 7 days later unless the wallet is topped up
string | null
recent
required
Array<object>
object
id
required
string
type
required
string
amount
required
object
amount
required
integer
currency
required
string
description
required
string | null
ref_id
required
The call, top-up or number it was for
string | null
created_at
required
string
Example
{ "balance": { "currency": "INR" }, "plan": { "id": "trial", "fee": { "currency": "INR" }, "extra_minute": { "currency": "INR" }, "pending_change": { "plan": "trial" } }, "recent": [ { "type": "topup", "amount": { "currency": "INR" } } ]}Invalid request
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
param
string
request_id
required
string
Example generated
{ "error": { "code": "example", "message": "example", "param": "example", "request_id": "example" }}Not signed in or bad API key
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
param
string
request_id
required
string
Example generated
{ "error": { "code": "example", "message": "example", "param": "example", "request_id": "example" }}Not allowed
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
param
string
request_id
required
string
Example generated
{ "error": { "code": "example", "message": "example", "param": "example", "request_id": "example" }}Not found
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
param
string
request_id
required
string
Example generated
{ "error": { "code": "example", "message": "example", "param": "example", "request_id": "example" }}