JSON API » invoices » invoices/sample
Creates a sample invoice.
Input parameters
Requires authentication and the commerce role privilege.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
plan | Integer | ID of rate plan. | Yes | |
encoding | String | "base64" to return contents base64 encoded, "raw" to return raw data. | No | "raw" |
Responses
Code | Description |
---|---|
200 | Success. |
400 | Invalid input parameters specified. Check the key and message fields for more details. |
401 | The authentication details provided are invalid. |
402 | Your role does not allow this. |
500 | An 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
Version | Changes |
---|---|
3.13 | Function added. |