Clients

Get a list of all clients

ENDPOINT
  GET /clients

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


RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
[{
    "id": 3,
    "addressLine1": "Number 1 Bullet Street",
    "addressLine2": "",
    "email": "myawesomeclient@email.com",
    "name": "My Awesome Client",
    "phoneNumber": "0871234567",
    "vatNumber": "1234567",
    "countryCode": "IE"
}, {
    "id": 1,
    "name": "My Client"
}]

Create a client

ENDPOINT
  POST /clients


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

SAMPLE createClient.json

{
    "name": "My Awesome Client",
    "email": "myawesomeclient@email.com",
    "addressLine1": "Number 1 Bullet Street",
    "addressLine2": "",
    "phoneNumber": "0871234567",
    "vatNumber": "1234567",
    "countryCode": "IE"
}

RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
{
    "id": 3,
    "addressLine1": "Number 1 Bullet Street",
    "addressLine2": "",
    "email": "myawesomeclient@email.com",
    "name": "My Awesome Client",
    "phoneNumber": "0871234567",
    "vatNumber": "1234567",
    "countryCode": "IE"
}

Get a client

ENDPOINT
  GET /clients/$client_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/clients/3


RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
{
    "id": 3,
    "addressLine1": "Number 1 Bullet Street",
    "addressLine2": "",
    "email": "myawesomeclient@email.com",
    "name": "My Awesome Client",
    "phoneNumber": "0871234567",
    "vatNumber": "1234567",
    "countryCode": "IE"
}

Update a client

When updating the client it is necessary to put the "id" of the element in the body aswell as the url otherwise you might get an error complaining that "name" is already used

ENDPOINT
  PUT /clients/[client_id]

SAMPLE CALL
     curl -u [your_bullet_username]:[your_api_key]
    -H "Accept: application/json"
    -H "Content-type: application/json"
    -X PUT
    https://accounts-app.bullethq.com/api/v1/clients/3
    --data @updateClient.json

SAMPLE updateClient.json

{
    "id": 3,
    "name": "My Awesome Client",
    "email": "newemailforawesomeclient@email.com",
    "addressLine1": "Number 1 Bullet Street",
    "addressLine2": "",
    "phoneNumber": "0871234567",
    "vatNumber": "1234567",
    "countryCode": "IE"
}

RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
{
    "id": 3,
    "addressLine1": "Number 1 Bullet Street",
    "addressLine2": "",
    "email": "newemailforawesomeclient@email.com",
    "name": "My Awesome Client",
    "phoneNumber": "0871234567",
    "vatNumber": "1234567",
    "countryCode": "IE"
}

Delete a client

ENDPOINT
  DELETE /clients/[client_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/clients/3

RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
{
    "id": 3,
    "addressLine1": "Number 1 Bullet Street",
    "addressLine2": "",
    "email": "myawesomeclient@email.com",
    "name": "My Awesome Cient",
    "phoneNumber": "0871234567",
    "vatNumber": "1234567",
    "countryCode": "IE"
}