Payments
Recording a payment on an invoice (either income or expense) is done here. The following payment methods are available:
Payments List
GET https://secure.ledgerble.com/api/1.0/payments
Returns a list of all payments in the following format:
{
"payments":
[
{
"id": 64,
"url": "https://secure.ledgerble.com/api/1.0/contacts/23/payments/64",
"date": "2010-01-15",
"amount": "500.00",
"account": {
"id": 45,
"url": "https://secure.ledgerble.com/api/1.0/accounts/45",
"name": "Checking Account"
},
"invoice": {
"id": 45,
"url": "https://secure.ledgerble.com/api/1.0/invoices/45",
"number": "00234",
"type": "income"
},
"contact": {
"id": 23,
"url": "https://secure.ledgerble.com/api/1.0/contacts/23",
"name": "Don Draper"
}
}
]
}
Contact's Payments
GET https://secure.ledgerble.com/api/1.0/contacts/{CONTACT_ID}/payments
Returns a list of all payments made to or from the {CONTACT_ID}. Returns the list in the same format as above.
Invoice's Payments
GET https://secure.ledgerble.com/api/1.0/invoices/{INVOICE_ID}/payments
Returns a list of all payments made towards the invoice {INVOICE_ID}. Returns the list in the same format as above.
Get Payment
GET https://secure.ledgerble.com/api/1.0/payments/{PAYMENT_ID}
Returns a single payment in the following format:
{
"payment": {
"id": 64,
"date": "2010-01-15",
"amount": "500.00",
"account": {
"id": 45,
"url": "https://secure.ledgerble.com/api/1.0/accounts/45",
"name": "Checking Account"
},
"invoice": {
"id": 45,
"url": "https://secure.ledgerble.com/api/1.0/invoices/45",
"number": "00234",
"type": "income"
},
"contact": {
"id": 23,
"url": "https://secure.ledgerble.com/api/1.0/contacts/23",
"name": "Don Draper"
}
}
}
New Payment
POST https://secure.ledgerble.com/api/1.0/invoices/{INVOICE_ID}/payments
Creates a new payment and makes it towards the invoice {INVOICE_ID}.
Please note that payments must be made towards an invoice, you cannot create
a payment directly to a contact.
(i.e.
POST https://secure.ledgerble.com/api/1.0/contacts/{CONTACT_ID}/payments
does not work!)
The following options are available:
| Variable | Required? | Description |
|---|---|---|
| account | Yes | Account ID# of the account the payment is being deposited into, or withdrawn from. |
| amount | Yes | The amount of the payment. |
| date | Yes | The date the payment was made. Format YYYY-MM-DD. |
Delete Payment
POST https://secure.ledgerble.com/api/1.0/payments/{PAYMENT_ID}/delete
Reverses a payment (the amount is put back into or taken out of the origin account) and removes it from the payments list.
