Supplier Payments

Get a list of all Supplier Payments

ENDPOINT
  GET /supplierPayments

SAMPLE CALL
  curl -u [your_bullet_username]:[your_api_key] https://accounts-app.bullethq.com/api/v1/supplierPayments


RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
[{
    "id": 1,
    "currency": "EUR",
    "amount": "615.00",
    "datePaid": "2014-01-01",
    "supplierId": 1,
    "bankAccountId": 1,
    "billIds": [2]
}, {
    "id": 2,
    "currency": "EUR",
    "amount": "615.00",
    "datePaid": "2014-01-01",
    "supplierId": 1,
    "bankAccountId": 1,
    "billIds": [1]
}] l

Create an supplier payment

Either "bankAccountId" or "employeeId" must be supplied when creating a supplier payment. The currency of the supplier payment must be in the same currency as the bill/bills it is paying. If the bank account is in a different currency, an "exchangeRate" must be supplied.

ENDPOINT
  POST /supplierPayments


SAMPLE CALL
    curl -u [your_bullet_username]:[your_api_key] \
    -H "Accept: application/json" \
    -H "Content-type: application/json" \
    --data @createSupplierPayment.json \
    -X POST \
    https://accounts-app.bullethq.com/api/v1/supplierPayments/

SAMPLE createSupplierPayment.json

{
    "currency": "EUR",
    "amount": "615",
    "datePaid": "2014-01-01",
    "supplierId": 1,
    "bankAccountId": 1,
}


RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
{
    "id": 1,
    "currency": "EUR",
    "amount": "615.00",
    "datePaid": "2014-01-01",
    "supplierId": 1,
    "bankAccountId": 1,
    "billIds": [2]
}

SAMPLE with an exchange rate

{
    "currency": "EUR",
    "exchangeRate" : 1.25
    "amount": "1900",
    "dateReceived": "2014-01-01",
    "clientId": 1,
    "bankAccountId": 5,
    "invoiceIds": [1, 2]
}

Get a supplier payment

ENDPOINT
  GET /supplierPayments/[supplier_payment_id]


SAMPLE CALL
    curl -u [your_bullet_username]:[your_api_key] \
    -H "Accept: application/json" \
    -H "Content-type: application/json" \
    -X GET \
    https://accounts-app.bullethq.com/api/v1/supplierPayments/2


RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
  {
    "id": 2,
    "currency": "EUR",
    "amount": "615.00",
    "datePaid": "2014-01-01",
    "supplierId": 1,
    "bankAccountId": 1,
    "billIds": [1]
}

Delete a supplier payment

ENDPOINT
  DELETE /supplierPayments/[supplier_payment_id]

SAMPLE CALL
    curl -u [your_bullet_username]:[your_api_key] \
    -H "Accept: application/json"         \
    -H "Content-type: application/json"  \
    -X DELETE     \
    https://accounts-app.bullethq.com/api/v1/supplierPayments/2

RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
  {
    "id": 2,
    "currency": "EUR",
    "amount": "615.00",
    "datePaid": "2014-02-01",
    "supplierId": 1,
    "bankAccountId": 1,
    "billIds": [1]
}