JSON API » plans » plans/update

Updates an existing rate plan.

Input parameters

Requires authentication and the commerce role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
idIntegerID of rate plan to update.Yes
auto_topupDecimalThe balance to top up to when doing an automatic topup.NoCurrent value.
bill_deferInteger1 to defer billing of features until start of next billing period, 0 not to.NoCurrent value.
bill_typeStringBilling type. "external", "none", "prepaid", "prepaid_invoices", "prepaid_calls", or "postpaid".NoCurrent value.
bulk_callsIntegerMaximum concurrent bulk dialler calls. -1 for default limit.NoCurrent value.
call_maximumDecimalMaximum spending on calls per customer per day. -1 for no limit.NoCurrent value.
callerid_in_externalInteger1 to pass callerid from inbound external calls to telephone lines, 0 not to.NoCurrent value.
carry_forward_messagesInteger1 to carry forward unused messages for one billing period, 0 not to.NoCurrent value.
carry_forward_secondsInteger1 to carry forward unused call seconds for one billing period, 0 not to.NoCurrent value.
conference_callsIntegerMaximum concurrent conference calls. -1 for no limit.NoCurrent value.
contractStringMinimum contract length. "1_month", "3_month", "6_month", "1_year", "18_month", "2_year", "3_year", or empty string for none.NoCurrent value.
cos_timegroupIntegerID of time group for class of service. 0 for none.NoCurrent value.
currencyStringCurrency costs are in.NoCurrent value.
descriptionStringDescription.NoCurrent value.
dialplanStringDial plan for the rate plan. Empty string for default.NoCurrent value.
external_outInteger1 to allow external calls by default, 0 not to.NoCurrent value.
huntgroup_destsIntegerMaximum destinations per hunt group. -1 for no limit.NoCurrent value.
included_messagesIntegerNumber of messages included free each billing period.NoCurrent value.
included_secondsIntegerNumber of calls seconds included free each billing period.NoCurrent value.
inconnect_marginDecimalProfit margin to add to inbound connect fee after markup.NoCurrent value.
inconnect_markupIntegerPercentage markup on inbound connect fee.NoCurrent value.
incost_marginDecimalProfit margin to add to inbound per-minute cost after markup.NoCurrent value.
incost_markupIntegerPercentage markup on inbound per-minute cost.NoCurrent value.
inheritableInteger1 to allow resellers to inherit their plans from this plan, 0 not to.NoCurrent value.
inmaximumIntegerMaximum concurrent inbound calls. -1 for no limit.NoCurrent value.
inmessage_marginDecimalProfit margin to add to inbound messages after markup.NoCurrent value.
inmessage_markupIntegerPercentage markup on inbound messages.NoCurrent value.
internal_outInteger1 to allow internal calls by default, 0 not to.NoCurrent value.
invoicesStringWhether to send invoices. "customer", "parent", "queue", or empty string for no invoices.NoCurrent value.
invoices_dueIntegerThe number of days after issue that invoices become due. 0 for immediate. -1 for manual.NoCurrent value.
invoices_overdueIntegerThe number of days after invoices become due that they become overdue. -1 for manual.NoCurrent value.
invoice_detailStringWhat detail to include on invoices. "summary", "transactions", "cdrs", "direction_cdrs", "group_cdrs", "source_cdrs", "group_transactions", "group_transactions_cdrs", "group_transactions_direction_cdrs", "group_transactions_group_cdrs", "group_transactions_source_cdrs", "transactions_cdrs", "transactions_direction_cdrs", "transactions_group_cdrs", or "transactions_source_cdrs".NoCurrent value.
invoice_formatStringFormat invoices are sent in. "pdf" or "xml".NoCurrent value.
low_balanceDecimalThe balance to trigger an automatic topup at.NoCurrent value.
nameStringName,NoCurrent value.
maxmsgIntegerMaximum messages per mailbox.NoCurrent value.
maxsecsIntegerMaximum message duration in seconds.NoCurrent value.
outconnect_marginDecimalProfit margin to add to outbound connect fee after markup.NoCurrent value.
outconnect_markupIntegerPercentage markup on outbound connect fee.NoCurrent value.
outcost_marginDecimalProfit margin to add to outbound per-minute cost after markup.NoCurrent value.
outcost_markupIntegerPercentage markup on outbound per-minute cost.NoCurrent value.
outmaximumIntegerMaximum concurrent outbound calls. -1 for no limit.NoCurrent value.
outmessage_marginDecimalProfit margin to add to outbound messages after markup.NoCurrent value.
outmessage_markupIntegerPercentage markup on outbound messages.NoCurrent value.
overmaxInteger1 to allow customers to go over maximum calls, 0 to reject calls.NoCurrent value.
pagegroup_destsIntegerMaximum destinations per page group. -1 for no limit.NoCurrent value.
parentIntegerID the plan inherits settings from. 0 for no parent.NoCurrent value.
payment_typeStringPayment type on signup. "creditcard", "direct_debit", "external", or "none".NoCurrent value.
peer1IntegerID of peer to send all outbound calls to. 0 to use routing exceptions.NoCurrent value.
periodStringBilling period. "daily", "weekly", "monthly", "2_monthly", "3_monthly", "6_monthly", "annually", or empty string for indefinite.NoCurrent value.
period_startStringWhen the billing period starts. "start" or "exact".NoCurrent value.
person_roleIntegerId of the first person's role on signup.NoCurrent value.
purge_messagesStringWhen to purge mailbox messages. "1_day", "1_week", "1_month", "3_months", "6_months", "1_year", or empty string for never.NoCurrent value.
queue_callsIntegerMaximum concurrent queue calls. -1 for no limit.NoCurrent value.
queue_destsIntegerMaximum destinations per queue. -1 for no limit.NoCurrent value.
record_maximumIntegerMaximum number of seconds of recordings to keep. -1 for unlimited.NoCurrent value.
require_tax_numberInteger1 to require tax number in signup, 0 not to.NoCurrent value.
roundingIntegerNumber of digits to round call prices to.NoCurrent value.
service_call_lockedInteger1 to forward calls to customer service if customer is locked, 0 not to.NoCurrent value.
service_copyInteger1 to copy customer service on emails to customers, 0 not to.NoCurrent value.
service_emailStringCustomer service email address. Empty string for none.NoCurrent value.
service_telephoneStringCustomer service telephone number. Empty string for none.NoCurrent value.
signup_topupInteger1 to attempt to topup the customer's account on signup. 0 not to.NoCurrent value.
sharedIntegerWhether the plan is shared. "resellers", "resellers_recursive", or empty string not to share.NoCurrent value.
totalmaximumIntegerMaximum concurrent total calls. -1 for no limit.NoCurrent value.
use_markupsInteger1 to use markups, 0 to reject calls if this plan has no matching cost exception.NoCurrent value.
validationInteger1 to validate input then return, 0 for full action.No0

Responses

CodeDescription
201Input passed validation. Only returned if validation=1.
204Success.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
403Your rate plan does not allow this.
404The rate plan does not exist, or you do not have permission to update it.

Data returned

No data is returned.

Example: Changing the name

http://enswitch.example.com/api/json/plans/update/?auth_username=user;auth_password=password;id=123;name=example

{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }

Change history

VersionChanges
3.15invoice_detail parameter updated to include grouped transactions. maxsecs input parameter added.
3.14inconnect, incost, inmessage, outconnect, outcost, and outmessage input parameters renamed to inconnect_markup, incost_markup, inmessage_markup, outconnect_markup, outcost_markup, and outmessage_markup. bulk_calls, conference_calls, huntgroup_dests, inconnect_margin, incost_margin, inmessage_margin, outconnect_margin, outcost_margin, outmessage_margin, pagegroup_dests, queue_calls, and queue_dests input parameters added.
3.13Function added.