Client Payments

Get a list of all client payments

ENDPOINT
  GET /clientPayments

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


RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
[{
    "id": 1,
    "currency": "EUR",
    "amount": "1,800.00",
    "dateReceived": "2014-01-01",
    "clientId": 1,
    "bankAccountId": 1,
    "invoiceIds": [2, 1]
}]

Create an client payment

The currency of the client payment must be in the same currency as the invoice/invoices it is paying. If the bank account is in a different currency, an "exchangeRate" must be supplied.

ENDPOINT
  POST /clientPayments


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

SAMPLE createClientPayment.json

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


RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
{
    "id": 1,
    "currency": "EUR",
    "amount": "1,900.00",
    "dateReceived": "2014-01-01",
    "clientId": 1,
    "bankAccountId": 1,
    "invoiceIds": [2, 1]
}

SAMPLE with an exchange rate

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

Get a client payment

ENDPOINT
  GET /clientPayments/[client_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-intl.bullethq.com/api/v1/clientPayments/1


RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
{
    "id": 1,
    "currency": "EUR",
    "amount": "1,900.00",
    "dateReceived": "2014-01-01",
    "clientId": 1,
    "bankAccountId": 1,
    "invoiceIds": [2, 1]
}

Delete a client payment

ENDPOINT
  DELETE /clientPayments/[client_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-intl.bullethq.com/api/v1/clientPayments/1

RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
{
    "id": 1,
    "currency": "EUR",
    "amount": "1,900.00",
    "dateReceived": "2014-01-01",
    "clientId": 1,
    "bankAccountId": 1,
    "invoiceIds": [2, 1]
}