Top

Apply to bill

List bills credited
GET /vendorcredits/:vendor_credit_id/applytobills
List bills to which the vendor credit is applied.
Apply credits to a bill
POST /vendorcredits/:vendor_credit_id/bills
Apply vendor credit to existing bills.
Delete bills credited
DELETE /vendorcredits/:vendor_credit_id/bills/:vendor_credit_bill_id
Delete the credits applied to a bill.

List bills credited

GET  /vendorcredits/:vendor_credit_id/applytobills

List bills to which the vendor credit is applied.

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
{
      "code": 0,
      "message": "success",
      "bills_credited": [
        {
          "vendor_credit_id": "460000000029003",
          "bill_id": "460000000027023",
          "vendor_credit_bill_id": "460000000029045",
          "date": "2013-08-06",
          "bill_number": "1",
          "vendor_credit_number": "DN-00002",
          "amount": 41.82
        }
      ]
    }

Apply credits to a bill

POST  /vendorcredits/:vendor_credit_id/bills

Apply vendor credit to existing bills.

Request attributes

bills array Amount applied from vendor credits to specified bills.
bill_id* string ID of the bill, the vendor credit is being applied.
amount_applied* double Amount applied to the bill.

Sample Request

{
      "bills": [
        {
          "bill_id": "3000000002075",
          "amount_applied": "12.2"
        }
      ]
    }

Sample Response

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

Delete bills credited

DELETE  /vendorcredits/:vendor_credit_id/bills/:vendor_credit_bill_id

Delete the credits applied to a bill.

Sample Response

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