Accounts-accountId-paymentInfo-paymentInfoId-payment:POST

From Hostway API Documentation
Jump to: navigation, search

POST /accounts/{accountId}/paymentInfo/{paymentInfoId}/payment

Make a one-time payment toward the account balance. First, a "pending" payment transaction will be created, and the payment amount will be reflected in the effective balance but not in the actual balance. After the payment has been processed (asynchronously), the payment status will change to "active" and the payment amount will be reflected in the actual balance as well.

Contents


Request

POST /accounts/{accountId}/paymentInfo/{paymentInfoId}/payment

Request Parameters

accountId
The ID of the account
paymentInfoId
The ID of the payment method

URI Parameters

None

Request Headers

Authorization - HTTP Authorization header [1]
The Authentication credentials of the client application.

Request Body

{
 "amount": {paymentAmount}
}
 

Parameters

paymentAmount - decimal
The amount of payment in the account's currency. Must be greater than zero.

Response

Status Code

204 No Content
The payment was successfully submitted
400 Bad Request
The request body was missing a required field or one of the fields did not comply with the requirements (in this case, the response body will contain hints for what went wrong)
401 Unauthorized
Authentication failed
403 Forbidden
Authentication succeeded, but the logged-in user is not allowed to create users in this account. The only users allowed to create users in this account are sales agents and account owners of this account. An account owner is any account user with the "sitecontrol_account_owner" role.
404 Not Found
The account or the payment method does not exist
409 Conflict
The payment cannot be submitted due to irregularities with the payment method. For example, this may happen if the credit card is expired, has reached its credit limit or is declined by the payment provider.

Response Headers

None

Response Body

None

Examples

Make a payment

POST https://api.hostway.com/accounts/smith123456/paymentInfo/cc-100075384/payment

{
  "amount": 100.00
}
 

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox