Top

Apply to invoice

List invoices credited
GET /creditnotes/:creditnote_id/invoices
List invoices to which the credit note is applied.
Credit to an invoice
POST /creditnotes/:creditnote_id/invoices
Apply credit note to existing invoices.
Delete invoices credited
DELETE /creditnotes/:creditnote_id/invoices/:creditnote_invoice_id
Delete the credits applied to an invoice.

List invoices credited

GET  /creditnotes/:creditnote_id/invoices

List invoices to which the credit note is applied.

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "success",
  "invoices_credited": [
    {
      "creditnote_id": "982000000567134",
      "invoice_id": "982000000567036",
      "creditnote_invoice_id": "982000000567172",
      "date": "2013-11-18",
      "invoice_number": "INV-00001",
      "creditnote_number": "CN-00001",
      "credited_amount": 12.20
    }
  ]
}

Credit to an invoice

POST  /creditnotes/:creditnote_id/invoices

Apply credit note to existing invoices.

Request attributes

invoices array Amount applied from credit notes to specified invoices.
invoice_id* string ID of the invoice, the credit note is being applied.
amount_applied* double Amount applied to the invoice.

Sample Request

{
          "invoices": [
            {
              "invoice_id": "460000000027023",
              "amount_applied": 41.82
            }
          ]
    }

Sample Response

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

Delete invoices credited

DELETE  /creditnotes/:creditnote_id/invoices/:creditnote_invoice_id

Delete the credits 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."
}