JSON API » invoices » invoices/sample

Creates a sample invoice.

Input parameters

Requires authentication and the commerce role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
planIntegerID of rate plan.Yes
encodingString"base64" to return contents base64 encoded, "raw" to return raw data.No"raw"

Responses

CodeDescription
200Success.
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.
500An internal error occurred. Check the key and message fields for more details.

Data returned

Fields of sample invoice. Since the invoice is not saved in the database, no ID or number is generated.

Example: With required parameters

http://enswitch.example.com/api/json/invoices/sample/?auth_username=user;auth_password=password;plan=123

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "data":"..." } }

Change history

VersionChanges
3.13Function added.