Top

Payments & Credits

List bill payments
GET /bills/:bill_id/payments
Get the list of payments made for a bill.
Apply credits
POST /bills/:bill_id/credits
Apply the vendor credits from excess vendor payments to a bill. Multiple credits can be applied at once.
Delete a payment
DELETE /bills/:bill_id/payments/:bill_payment_id
Delete a payment made to a bill.

List bill payments

GET  /bills/:bill_id/payments

Get the list of payments made for a bill.

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "success",
  "payments": [
    {
      "payment_id": "460000000042059",
      "bill_id": "460000000042035",
      "bill_payment_id": "460000000042061",
      "vendor_id": "460000000038029",
      "vendor_name": "Will Cooper",
      "payment_mode": "Cash",
      "description": "",
      "date": "2013-09-11T16:48:14+0530",
      "reference_number": "43218995",
      "exchange_rate": 1.23,
      "amount": 31.25,
      "paid_through": "Undeposited Funds",
      "is_single_bill_payment": true
    }
  ]
}

Apply credits

POST  /bills/:bill_id/credits

Apply the vendor credits from excess vendor payments to a bill. Multiple credits can be applied at once.

Request attributes

payment_id string ID of the payment from which credit has to be applied.
amount_applied* double Amount applied to the bill.

Sample Request

{
      "bill_payments": [
        {
          "payment_id": "460000000042059",
          "amount_applied": 31.25
        }
      ]
    }

Sample Response

Status: 201 Created
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "Credits have been applied to the bill(s)."
}

Delete a payment

DELETE  /bills/:bill_id/payments/:bill_payment_id

Delete a payment made to a bill.

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "The payment has been deleted."
}