JSON API » charges » charges/update
Updates an existing charge.
Input parameters
Requires authentication and the administrator or wholesale role privileges.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
id | Integer | ID of charge to update. | Yes | |
amount | Decimal | Amount to charge customer, excluding taxes. | No | Current value. |
buy | Decimal | Amount item cost, excluding taxes. Used for calculating profits. | No | Current value. |
currency | String | Currency amount and buy are in. | No | Current value. |
description | String | Description. | No | Current value. |
end | Integer | End Unix timestamp. | No | Current value. |
name | String | Name. | No | Current value. |
number | Integer | Number of times to charge. | No | Current value. |
period | String | Period. "once", "monthly", "quarterly", "annually", or empty string for immediately. | No | Current value. |
start | Integer | Start Unix timestamp. | No | Current value. |
validation | Integer | 1 to validate input then return, 0 for full action. | No | 0 |
Responses
Code | Description |
---|---|
201 | Input passed validation. Only returned if validation=1. |
204 | 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. |
404 | The charge does not exist, or you do not have permission to update it. |
Data returned
No data is returned.
Example: Changing the name
{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }
Change history
Version | Changes |
---|---|
3.13 | Function added. |