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.
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.
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_timegroupDecimalID 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.
included_messagesIntegerNumber of messages included free each billing period.NoCurrent value.
included_secondsIntegerNumber of calls seconds included free each billing period.NoCurrent value.
inconnectIntegerPercentage markup on inbound connect fee.NoCurrent value.
incostIntegerPercentage 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.
inmessageIntegerPercentage 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", "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.
outconnectIntegerPercentage markup on outbound connect fee.NoCurrent value.
outcostIntegerPercentage markup on outbound per-minute cost.NoCurrent value.
outmaximumIntegerMaximum concurrent outbound calls. -1 for no limit.NoCurrent value.
outmessageIntegerPercentage markup on outbound messages.NoCurrent value.
overmaxInteger1 to allow customers to go over maximum calls, 0 to reject calls.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.
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.13Function added.