The Brew Ha Ha API (1.0.0)

Download OpenAPI specification:Download

The Brew Ha Ha API allows third-party applications to access our extensive line of coffee and snack products. As a developer, you can access various endpoints to get a single product, get a collection of products, or place orders. Our API enables seamless integration with popular e-commerce platforms such as Shopify, Wix, and Square.

tokens

Use these endpoints generate a JSON Web Token (JWT) to authenticate your credentials.

tokens_create

Takes a set of user credentials and returns an access and refresh JSON web token pair to prove the authentication of those credentials.

Request Body schema:
required
username
required
string
password
required
string

Responses

Request samples

Content type
{
  • "username": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "access": "string",
  • "refresh": "string"
}

tokens_refresh_create

Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid.

Request Body schema:
required
refresh
required
string

Responses

Request samples

Content type
{
  • "refresh": "string"
}

Response samples

Content type
application/json
{
  • "access": "string",
  • "refresh": "string"
}

orders

Use this endpoint to submit a new order.

create_order

Order available products from the database

Authorizations:
JWTAuth
Request Body schema:
required
payment_method
required
string

The payment method used

required
Array of objects (OrderItem)

The items in the customer's order. Provide the product_id and quantity for each product.

Responses

Request samples

Content type

Example of a request to create an order

{
  • "payment_method": "Credit",
  • "order_items": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

retrieve_orders

Returns a single order from the database

Authorizations:
JWTAuth
path Parameters
id
required
integer

A unique integer value identifying this order.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

products

Use this endpoint to get a single product or a list of products from the database.

list_products

Returns a list of all products in the database

Authorizations:
JWTAuth

Responses

Response samples

Content type
application/json
[
  • [
    ]
]

retrieve_products

Returns a single product from the database

Authorizations:
JWTAuth
path Parameters
id
required
integer

A unique integer value identifying this product.

Responses

Response samples

Content type
application/json
[
  • {
    }
]