JSON API » charges » charges/charge

Charges an existing charge immediately. This should normally only be called after charges/create and setting any required taxes. If the charge's period is set to once, the entire amount is charged. If set to monthly, quarterly, or annually, a pro-rata amount is charged. A transaction is recorded and the customer(s) balance(s) is/are updated.

Input parameters

Requires authentication and the commerce role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
idIntegerID of charge to charge.Yes

Responses

CodeDescription
204Success.
401The authentication details provided are invalid.
402Your role does not allow this.
404The charge does not exist, or you do not have permission to view it.

Data returned

No data is returned.

Example: With required parameters

http://enswitch.example.com/api/json/charges/charge/?auth_username=user;auth_password=password;id=123

{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }

Change history

VersionChanges
3.13Function added.