Add Payment

To add a payment record to your DB, use the following request:

Be aware, that starting with OnApp 5.4 version, the request below will be deprecated. Instead, only the Create User Payment request will be used.

POST /users/:user_id/payments.xml
POST /users/:user_id/payments.json

XML Request Example

curl -i -X POST -d '<payment><amount>12</amount><invoice_number>123</invoice_number></payment>' -H 'Accept: application/xml' -H 'Content-type: application/xml'-u user:userpass -url http://onapp.test/users/12/payments.xml

JSON Request Example

curl -i -X POST -d '{"payment":{"amount":"12","invoice_number":"123"}}' -H 'Accept: application/json' -H 'Content-type: application/json'-u user:userpass --url http://onapp.test/users/12/payments.json 

Where:

amount* - amount of the payment (should be higher than zero)

invoice_number - optional number of the invoice