Vendors

API endpoint for manage vendors.

Data management

/api/vendors

GET /storekeeper/api/vendors

List vendors

Status Codes:

Example request:

GET /storekeeper/api/vendors HTTP/1.1
Host: localhost:8000
Content-Type: application/json

Example response:

HTTP/1.0 200 OK
Content-Type: application/json

[
  {
    "id": 1,
    "name": "Heavy Duty Ltd."
  },
  {
    "id": 2,
    "name": "Star Shop Ltd."
  }
]
POST /storekeeper/api/vendors

Create vendor

Status Codes:

Example request:

POST /storekeeper/api/vendors HTTP/1.1
Host: localhost:8000
Content-Type: application/json

{
  "name": "Heavy Duty Ltd."
}

Example response:

HTTP/1.0 201 CREATED
Content-Type: application/json

{
  "id": 1,
  "name": "Heavy Duty Ltd."
}

/api/vendors/<id>

GET /storekeeper/api/vendors/(int: id)

Get vendor

Parameters:
  • id – ID of selected vendor for get
Status Codes:

Example request:

GET /storekeeper/api/vendors/1 HTTP/1.1
Host: localhost:8000
Content-Type: application/json

Example response:

HTTP/1.0 200 OK
Content-Type: application/json

{
  "id": 1,
  "name": "Heavy Duty Ltd."
}
PUT /storekeeper/api/vendors/(int: id)

Update vendor

Parameters:
  • id – ID of selected vendor for put
Status Codes:

Example request:

PUT /storekeeper/api/vendors/1 HTTP/1.1
Host: localhost:8000
Content-Type: application/json

{
  "name": "new_foo"
}

Example response:

HTTP/1.0 200 OK
Content-Type: application/json

{
  "id": 1,
  "name": "new_foo"
}
DELETE /storekeeper/api/vendors/(int: id)

Delete vendor

Parameters:
  • id – ID of selected vendor for delete
Status Codes:

Example request:

DELETE /storekeeper/api/vendors/1 HTTP/1.1
Host: localhost:8000
Content-Type: application/json

Example response:

HTTP/1.0 200 OK
Content-Type: application/json

null