Suppliers

Get a list of all suppliers

ENDPOINT
  GET /suppliers

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


RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
[{
    "id": 1,
    "addressLine1": "Number 1 Bullet Street",
    "addressLine2": "",
    "name": "My Awesome Supplier",
    "phoneNumber": "0871234567",
    "vatNumber": "1234567",
    "countryCode": "IE"
}, {
    "id": 2,
    "addressLine1": "Number 2 Bullet Street",
    "addressLine2": "",
    "name": "My Other Awesome Supplier",
    "phoneNumber": "0871234568",
    "vatNumber": "1234568"
}]

Create a supplier

ENDPOINT
  POST /suppliers


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

SAMPLE createSupplier.json

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


RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
{
    "id": 1,
    "addressLine1": "Number 1 Bullet Street",
    "addressLine2": "",
    "name": "My Awesome Supplier",
    "phoneNumber": "0871234567",
    "vatNumber": "1234567",
    "countryCode": "IE"
}

Get a supplier

ENDPOINT
  GET /suppliers/[supplier_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/suppliers/1


RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
{
    "id": 1,
    "addressLine1": "Number 1 Bullet Street",
    "addressLine2": "",
    "name": "My Awesome Supplier",
    "phoneNumber": "0871234567",
    "vatNumber": "1234567",
    "countryCode": "IE"
}

Update a supplier

When updating the supplier 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 /suppliers/[supplier_id]

SAMPLE updateSupplier.json

{
    "id" : 1,
    "name": "My Awesome Supplier",
    "email": "myawesomesupplier@email.com",
    "addressLine1": "New Address",
    "addressLine2": "",
    "phoneNumber": "0871234568",
    "vatNumber": "1234568",
    "countryCode": "UK"
}



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


RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
{
    "id": 1,
    "addressLine1": "New Address",
    "addressLine2": "",
    "name": "My Awesome Supplier",
    "phoneNumber": "0871234568",
    "vatNumber": "1234568"
}

Delete a supplier

ENDPOINT
  DELETE /suppliers/[supplier_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/suppliers/1

RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE

{
    "id": 1,
    "addressLine1": "New Address",
    "addressLine2": "",
    "name": "My Awesome Supplier",
    "phoneNumber": "0871234568",
    "vatNumber": "1234568"
}