Create a Subaccount
Overview
As of v3.0, SMS Central gives you the ability to create sub-accounts via the API as well as add users to that sub-account. To do this, you would send a HTTP GET or POST to the API URL.
Of course, you can also log into your SMS Central account to create sub-accounts via the web portal.
Note: This functionality requires your account to be configured as a partner account. Please contact SMS Central’s support team for this to be enabled.
Account URL
All HTTP POSTS sent to SMS Central’s API to create a subaccount must go to the following URL:
https://my.smscentral.com.au/api/v3.2/account/create |
Parameters
The parameters below are POST parameters that can be provided in order to create a subaccount.
Parameter | Required | Type | Possible Value/ Example |
USERNAME | Yes | String | |
PASSWORD | Yes | String | |
ACCOUNT | Yes | JSON string | See definition below. |
HTTP Post Parameters Definitions
USERNAME
- Type: string
- Description: This is the Username for your SMS Central account
PASSWORD
- Type: string
- Description: This is the Password for your SMS Central account
ACCOUNT
- Type: JSON-formatted string
- Description: This is where you will provide the details and settings, in JSON-format, of the account being created.
JSON Field | Required | Value Type & Possible/ Example Value(s) |
ACCOUNTNAME | YES | String containing the name of the account to be created. |
PARENTACCOUNT | No | Integer value containing the ID of the parent account. See further notes |
PAYMENTMODEL | Yes | String value ‘prepaid’ or ‘postpaid’ denoting a Pre-paid or Post-paid subaccount, respectively. See further notes. |
MONTHLYVOLUMELIMIT | No | Integer with monthly volume limit, leaving this out means no limit will be applied. |
INVOICINGACCOUNT | No | ID of the account which should be invoiced for usage. Leave out to invoice to account being created. See further notes. |
ACCOUNT - JSON Further Notes
PARENTACCOUNT
If you wish to create a multi-level hierarchical structure, you may do so by providing the ID of the account which should be the ‘parent’ (one level higher in hierarchical structure) of the account being created. As this is an optional field, if you do not provide a value or do not provide this field at all, the account (for which you are submitting your username & password) will be determined as the ‘Parent’ account of the subaccount being created.
Note: You will have the ID an account by having created that account via the API first, saving the Account ID provided in the response. See “Response to your HTTP POST”.
MONTHLYVOLUMELIMIT
You are able to set a monthly volume limit on the account you are creating by providing an integer value to this JSON field. If you do not provide this field in the JSON object, no monthly volume limit will be set for the account being created.
PAYMENTMODEL
This allows you to determine whether the account you are creating will require credits to be purchased (and/or allocated via the UI) up-front (making them prepaid) or whether they are able to send SMS messages without restriction and will be invoiced by SMS Central for the usage at the end of the month (making them ‘postpaid’). If your account (the top-level account in the hierarchical structure) is a pre-paid account, then setting a ‘postpaid’ subaccount will mean messages sent from that subaccount will automatically deduct from the pre-paid balance of your parent account.
INVOICINGACCOUNT
You are able to determine your billing & invoicing structure by providing the ID of the account which should be receiving the invoices for the usage of the subaccount being created. You may provide the ID of the immediate parent account, or the ID of an account higher up the hierarchy, or you may leave this value out entirely in which case the account being created will be determined as the account being invoiced for its own usage.
Note: This only applies if the sub-account being created will have a ‘postpaid’ value for its PAYMENTMODEL.
Response
After sending your HTTP POST with the required parameters to the Account URL to create a sub-account, SMS Central will return a “HTTP/1.1 200 OK” HTTP status code in the header of the response to your HTTP POST and JSON-formatted content, providing your details of the account created.
The JSON Response will be of the following format:
- On Success
{ “account” :
“name” : “String value containing the name of the account, as per your
ACCOUNTNAME value”,
“ID” : [integer value containing the unique ID of this account]
}
- On Failure
{ “error” :
“errorcode” : [integer value containing an error code unique to error type],
“errordescription” : “String description of the error that has occurred”
}
Copyright © 2023 SMS Central by Sinch MessageMedia