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": "460000000029055",
      "payment_number": "1",
      "invoice_id": "460000000027023",
      "invoice_payment_id": "460000000029057",
      "payment_mode": "PayPal",
      "description": "",
      "date": "2013-08-06",
      "reference_number": "RSAFDG132423",
      "exchange_rate": 1.00,
      "amount": 200.00,
      "tax_amount_withheld": 0.00,
      "is_single_invoice_payment": true
    },
    {
      "payment_id": "460000000031003",
      "payment_number": "2",
      "invoice_id": "460000000027023",
      "invoice_payment_id": "460000000031033",
      "payment_mode": "Cash",
      "description": "",
      "date": "2013-08-14",
      "reference_number": "RSAFDG132424",
      "exchange_rate": 1.00,
      "amount": 30.00,
      "tax_amount_withheld": 0.00,
      "is_single_invoice_payment": false
    },
    {
      "payment_id": "460000000053123",
      "payment_number": "6",
      "invoice_id": "460000000027023",
      "invoice_payment_id": "460000000053125",
      "payment_mode": "Stripe",
      "description": "",
      "date": "2013-10-07",
      "reference_number": "",
      "exchange_rate": 1.00,
      "amount": 47.50,
      "tax_amount_withheld": 0.00,
      "is_single_invoice_payment": false
    }
  ]
}

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": "460000000029003",
      "creditnotes_invoice_id": "460000000029045",
      "creditnotes_number": "CN-00001",
      "credited_date": "2013-08-06",
      "amount_applied": 41.82
    },
    {
      "creditnote_id": "460000000029003",
      "creditnotes_invoice_id": "460000000031069",
      "creditnotes_number": "CN-00001",
      "credited_date": "2013-08-06",
      "amount_applied": 22.50
    }
  ]
}

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).",
      "use_credits": {
                "invoice_payments": [
                    {
                        "invoice_payment_id": "460000000031033",
                        "payment_id": "460000000031003",
                        "invoice_id": "460000000027023",
                        "amount_used": 30.00
                    }
                ],
                "apply_creditnotes": [
                    {
                        "creditnotes_invoice_id": "460000000031069",
                        "creditnote_id": "460000000029003",
                        "invoice_id": "460000000027023",
                        "amount_applied": 22.50
                    }
                ]
            }
    }

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."
}