| Code | Description | Schema |
|---|---|---|
| 201 | Account created | Session |
| 409 | Email already registered | Error |
| Code | Description | Schema |
|---|---|---|
| 200 | Signed in | Session |
| 401 | Bad credentials | Error |
| Name | In | Type | Description |
|---|---|---|---|
| q | query | string | Full-text query |
| limit | query | integer | Page size, max 100 |
| Code | Description | Schema |
|---|---|---|
| 200 | A page of books | Book[] |
| Name | In | Type | Description |
|---|---|---|---|
| id * | path | ULID | Book id |
| Code | Description | Schema |
|---|---|---|
| 200 | The book | Book |
| 404 | No such book | Error |
| Code | Description | Schema |
|---|---|---|
| 201 | Book created | Book |
| 401 | Not signed in | Error |
| Name | In | Type | Description |
|---|---|---|---|
| id * | path | ULID | Book id |
| Code | Description | Schema |
|---|---|---|
| 200 | Updated book | Book |
| 404 | No such book | Error |
| Name | In | Type | Description |
|---|---|---|---|
| id * | path | ULID | Book id |
| Code | Description | Schema |
|---|---|---|
| 204 | Deleted, no body | — |
| 404 | No such book | Error |
| Code | Description | Schema |
|---|---|---|
| 200 | A page of orders | Order[] |
| 401 | Not signed in | Error |
| Code | Description | Schema |
|---|---|---|
| 201 | Order placed | Order |
| 422 | Empty or invalid cart | Error |
| Property | Type | Required |
|---|---|---|
| string | required | |
| password | string | required |
| Property | Type | Required |
|---|---|---|
| token | string | required |
| user_id | ULID | required |
| expires_at | datetime | required |
| Property | Type | Required |
|---|---|---|
| id | ULID | required |
| title | string | required |
| author_id | ULID | required |
| price_cents | integer | required |
| isbn | string | optional |
| Property | Type | Required |
|---|---|---|
| title | string | required |
| author_id | ULID | required |
| price_cents | integer | required |
| isbn | string | optional |
| Property | Type | Required |
|---|---|---|
| items | LineItem[] | required |
| Property | Type | Required |
|---|---|---|
| book_id | ULID | required |
| quantity | integer | required |
| Property | Type | Required |
|---|---|---|
| id | ULID | required |
| status | enum(cart,paid,shipped) | required |
| total_cents | integer | required |
| items | LineItem[] | required |
| Property | Type | Required |
|---|---|---|
| code | string | required |
| message | string | required |