Top

Payments & Credits

List invoice payments
GET /invoices/:invoice_id/payments
Get the list of payments made for an invoice.
List credits applied
GET /invoices/:invoice_id/creditsapplied
Get the list of credits applied for an invoice.
Apply credits
POST /invoices/:invoice_id/credits
Apply the customer credits either from credit notes or excess customer payments to an invoice. Multiple credits can be applied at once.
Delete a payment
DELETE /invoices/:invoice_id/payments/:invoice_payment_id
Delete a payment made to an invoice.
Delete applied credit
DELETE /invoices/:invoice_id/creditsapplied/:creditnotes_invoice_id
Delete a particular credit applied to an invoice.

List invoice payments

GET  /invoices/:invoice_id/payments

Get the list of payments made for an invoice.

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "success",
  "payments": [
    {
      "payment_id": "982000000567190",
      "payment_number": "7",
      "invoice_id": "982000000567036",
      "invoice_payment_id": "982000000567192",
      "payment_mode": "Cash",
      "description": "",
      "date": "2013-11-18",
      "reference_number": "99782374",
      "exchange_rate": 1.00,
      "amount": 10.57,
      "tax_amount_withheld": 0.00,
      "is_single_invoice_payment": true
    },
    {
      "payment_id": "982000000567202",
      "payment_number": "8",
      "invoice_id": "982000000567036",
      "invoice_payment_id": "982000000567204",
      "payment_mode": "PayPal",
      "description": "",
      "date": "2013-11-18",
      "reference_number": "78872356478",
      "exchange_rate": 1.00,
      "amount": 16.34,
      "tax_amount_withheld": 0.00,
      "is_single_invoice_payment": true
    }
  ]
}

List credits applied

GET  /invoices/:invoice_id/creditsapplied

Get the list of credits applied for an invoice.

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "success",
  "credits": [
    {
      "creditnote_id": "982000000567134",
      "creditnotes_invoice_id": "982000000567172",
      "creditnotes_number": "CN-00001",
      "credited_date": "2013-11-18",
      "amount_applied": 12.20
    },
    {
      "creditnote_id": "982000000567148",
      "creditnotes_invoice_id": "982000000567174",
      "creditnotes_number": "CN-00002",
      "credited_date": "2013-11-19",
      "amount_applied": 10.23
    }
  ]
}

Apply credits

POST  /invoices/:invoice_id/credits

Apply the customer credits either from credit notes or excess customer payments to an invoice. Multiple credits can be applied at once.

Request attributes

invoice_payments array Payments applied to an invoice.
payment_id string ID of the payment from which credit has to be applied.
amount_applied double Amount applied to the invoice.
apply_creditnotes array Credits applied to invoice.
creditnote_id string ID of the credit note from which credit has to be applied.

Sample Request

{
           "invoice_payments": [
                {
                  "payment_id": "460000000031003",
                  "amount_applied": 15.00
                }
              ],
              "apply_creditnotes": [
                {
                  "creditnote_id": "460000000029003",
                  "amount_applied": 22.50
                }
              ]
        }

Sample Response

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

Delete a payment

DELETE  /invoices/:invoice_id/payments/:invoice_payment_id

Delete a payment made to an invoice.

Sample Response

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

Delete applied credit

DELETE  /invoices/:invoice_id/creditsapplied/:creditnotes_invoice_id

Delete a particular credit applied to an invoice.

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "Credits applied to an invoice have been deleted."
}