payments
Create payment
Changed onAdds an Payment to the system
post/api/v1/payments
Request
- Base URLhttps://demo.invoiceninja.com
- Authnone declared. Required headers: X-API-TOKEN, X-Requested-With
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
includestring
Example:first_load
Includes child relationships in the response, format is comma separated. Check each model for the list of associated includes
email_receiptboolean
If true, the payment will be emailed to the client. If false, no email will be sent. This will override any other email settings for payments.
Headers
X-API-TOKENstring required
Example:TOKEN
The API token to be used for authentication
X-Requested-Withstring required
Example:XMLHttpRequest
Used to send the XMLHttpRequest header
Request body
Example request
{
"client_id": "Opnel5aKBz",
"client_contact_id": "Opnel5aKBz",
"user_id": "Opnel5aKBz",
"type_id": "1",
"date": "2024-01-01",
"transaction_reference": "xcsSxcs124asd",
"assigned_user_id": "Opnel5aKBz",
"private_notes": "The payment was refunded due to error",
"amount": 10,
"invoices": [
{
"invoice_id": "Opnel5aKBz",
"amount": "2"
}
],
"credits": [
{
"credit_id": "Opnel5aKBz",
"amount": "2"
}
],
"number": "PAY_101"
}Response
Returns the saved Payment object
Example response
{
"id": "Opnel5aKBz",
"client_id": "Opnel5aKBz",
"invitation_id": "Opnel5aKBz",
"client_contact_id": "Opnel5aKBz",
"user_id": "Opnel5aKBz",
"type_id": "1",
"date": "1-1-2014",
"transaction_reference": "xcsSxcs124asd",
"assigned_user_id": "Opnel5aKBz",
"private_notes": "The payment was refunded due to error",
"is_manual": true,
"is_deleted": true,
"amount": 10,
"refunded": 10,
"updated_at": 1434342123,
"archived_at": 1434342123,
"company_gateway_id": "3",
"paymentables": {
"id": "AS3df3A",
"invoice_id": "AS3df3A",
"credit_id": "AS3df3A",
"refunded": 10,
"amount": 10,
"updated_at": 1434342123,
"created_at": 1434342123
},
"invoices": [
{
"invoice_id": "Opnel5aKBz",
"amount": "2"
}
],
"credits": [
{
"credit_id": "Opnel5aKBz",
"amount": "2"
}
],
"number": "PAY_101",
"category_id": "Opnel5aKBz",
"custom_value1": "Payment reference 123",
"custom_value2": "Approved by John",
"custom_value3": "Urgent payment",
"custom_value4": "Q1 2024",
"exchange_currency_id": "2",
"exchange_rate": 1,
"idempotency_key": "key_1234567890abcdef"
}Changes
- info
the response optional property
became read-only for the status - info
the response optional property
/became read-only for the status
- info
- breaking
the
request property format changed from no format todate
- breaking