Customers

API endpoint for manage customers.

Data management

/api/customers

GET /storekeeper/api/customers

List customers

Status Codes:

Example request:

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

Example response:

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

[
  {
    "id": 1,
    "name": "Big Customer Ltd."
  },
  {
    "id": 2,
    "name": "Buy Everything Co."
  }
]
POST /storekeeper/api/customers

Create customer

Status Codes:

Example request:

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

{
  "name": "Big Customer Ltd."
}

Example response:

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

{
  "id": 1,
  "name": "Big Customer Ltd."
}

/api/customers/<id>

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

Get customer

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

Example request:

GET /storekeeper/api/customers/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": "Big Customer Ltd."
}
PUT /storekeeper/api/customers/(int: id)

Update customer

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

Example request:

PUT /storekeeper/api/customers/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/customers/(int: id)

Delete customer

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

Example request:

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

Example response:

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

null