Products

Products are definitions of physical products in our webshop. These products are usually supplied and delivered by the organization itself.

The products model

The products model contains information about the product itself and extra information regarding webshop availability. The model is defined as follows:

Properties

  • Name
    identifier
    Type
    string
    Description

    Unique identifier for the product.

  • Name
    price
    Type
    float
    Description

    The sale price of the product.

  • Name
    points
    Type
    integer
    Description

    The sale amount of points of the product.

  • Name
    show_title
    Type
    boolean
    Description

    whether or not to show the title in the webshop.

  • Name
    show_subtitle
    Type
    boolean
    Description

    whether or not to show the subtitle in the webshop.

  • Name
    organization
    Type
    object
    Description

    Contains in formation about the products organization. contains: ['identifier', 'name']

  • Name
    primary_color
    Type
    string
    Description

    A Hexadecimal color code for the primary color of the product (background color for the webshop).

  • Name
    text_color
    Type
    string
    Description

    A Hexadecimal color code for the text color of the product (text color for the webshop).

  • Name
    ribbon_color
    Type
    string
    Description

    A Hexadecimal color code for the ribbon color of the product (label color for the webshop).

  • Name
    title
    Type
    string
    Description

    The title of the product.

  • Name
    subtitle
    Type
    string
    Description

    The subtitle of the product.

  • Name
    thumbnail_url
    Type
    string|url
    Description

    The URL to the image of the product.

  • Name
    start_date
    Type
    timestamp
    Description

    Used to set the availablity of the product in the webshop.

  • Name
    end_date
    Type
    timestamp
    Description

    Used to set the availablity of the product in the webshop.

  • Name
    use_start_and_end
    Type
    boolean
    Description

    whether or not to use a start and end date in the webshop.

  • Name
    sale
    Type
    boolean
    Description

    whether or not the product is on sale.

  • Name
    sale_points
    Type
    integer
    Description

    The sale amount of points of the product.

  • Name
    sale_price
    Type
    float
    Description

    The sale price of the product.

  • Name
    sale_text
    Type
    string
    Description

    The text to show when the product is on sale.

  • Name
    stock
    Type
    integer
    Description

    The amount of stock of the product.

  • Name
    use_stock
    Type
    boolean
    Description

    whether or not to use a stock in the webshop.

  • Name
    created_at
    Type
    timestamp
    Description

    A timestamp when the product was created.

  • Name
    updated_at
    Type
    timestamp
    Description

    A timestamp when the product was last updated.

Note

Because a user can have access to multiple organizations we require a organization_id to be provided for most requests. We will also return an organization reference in each response.


GET/products

List all products

This endpoint returns a list of all the products the currently authenticated user has access to.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    products.get
    Type
    string
    Description

    The scope required to access this endpoint.

Request

GET
/products
curl -X GET https://api.walletapp.co/products 
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"

Response

{
    "message": "Request successful",
    "data": [
        {
            "created_at": "<timestamp>",
            "end_date": "<timestamp>",
            "identifier": "<product_id>",
            "organization": {
                "name": "<organization_name>",
                "identifier": "<organization_id>"
            },
            "points": 0,
            "price": 0,
            "primary_color": "<hex_color>",
            "sale": 0,
            "sale_points": 0,
            "sale_price": 0.00,
            "sale_text": "<sale_text>",
            "show_subtitle": 0,
            "show_title": 0,
            "start_date": "<timestamp>",
            "stock": 0,
            "subtitle": "<subtitle>",
            "text_color": "<hex_color>",
            "thumbnail_url": "<url>",
            "title": "<title>",
            "updated_at": "<timestamp>",
            "use_start_and_end": 0,
            "use_stock": 0
        }
    ],
    ...
}

POST/products

Create a product

This endpoint allows you to create a product.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    products.store
    Type
    string
    Description

    The scope required to access this endpoint.

Request body

  • Name
    title
    Type
    string|Required
    Description

    The title of the product.

  • Name
    subtitle
    Type
    string|Required
    Description

    The subtitle of the product.

  • Name
    organization_id
    Type
    string|Required
    Description

    The identifier of the organization the product should be created for.

  • Name
    description
    Type
    string
    Description

    The description of the product.

  • Name
    thumbnail_url
    Type
    string|url
    Description

    A valid url to the thumbnail image of the product.

  • Name
    show_title
    Type
    boolean
    Description

    whether or not to show the title of the product.

  • Name
    show_subtitle
    Type
    boolean
    Description

    whether or not to show the subtitle of the product.

  • Name
    price
    Type
    float
    Description

    The webshop price of the product.

  • Name
    points
    Type
    integer
    Description

    The webshop amount of points the product should cost.

  • Name
    use_stock
    Type
    boolean
    Description

    whether or not the product makes use of stock.

  • Name
    stock
    Type
    integer
    Description

    The amount of stock the product has.

  • Name
    use_start_and_end
    Type
    boolean
    Description

    whether or not the product makes use of start and end dates.

  • Name
    sale
    Type
    boolean
    Description

    whether or not the product is on sale.

  • Name
    sale_price
    Type
    float
    Description

    The sale price of the product.

  • Name
    sale_points
    Type
    integer
    Description

    The sale amount of points the product should cost.

  • Name
    sale_text
    Type
    string
    Description

    The sale text of the product.

  • Name
    start_date
    Type
    timestamp
    Description

    The start date of the product.

  • Name
    end_date
    Type
    timestamp
    Description

    The end date of the product.

Request

POST
/products
curl -X POST https://api.walletapp.co/products 
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"
-d '{
    "title":"<title>",
    "subtitle":"<subtitle>",
    "description":"<description>",
    "organization_id":"<organization_id>",
    "thumbnail_url":"<image_url>",
    "show_title": true,
    "price": 12.50,
    "primary_color":"#ff00ff",
    "text_color":"#0000ff",
    "show_subtitle":true,
    "points": 123,
    "use_stock":true,
    "use_start_and_end": true,
    "sale": true,
    "sale_text": "<sale_text>",
    "sale_price":12.50,
    "sale_points":12,
    "stock":12,
    "start_date":"2022-01-01",
    "end_date":"2023-01-01"
}'

Response

{
"message": "Request successful"
"data": {
    "created_at": "<timestamp>",
    "end_date": "<timestamp>",
    "identifier": "<product_id>",
    "organization": {
        "name": "<organization_name>",
        "identifier": "<organization_id>"
    },
    "points": 0,
    "price": 0,
    "primary_color": "<hex_color>",
    "sale": 0,
    "sale_points": 0,
    "sale_price": 0.00,
    "sale_text": "<sale_text>",
    "show_subtitle": 0,
    "show_title": 0,
    "start_date": "<timestamp>",
    "stock": 0,
    "subtitle": "<subtitle>",
    "text_color": "<hex_color>",
    "thumbnail_url": "<url>",
    "title": "<title>",
    "updated_at": "<timestamp>",
    "use_start_and_end": 0,
    "use_stock": 0
}
}


GET/products/:identifier

Inspect a product

The endpoint allows you to fetch a product by its identifier.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    products.get
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string
    Description

    The id of the product you want to update.

Request

GET
/products/:identifier
curl -X GET https://api.walletapp.co/products/:identifier
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"

Response

{
    "message": "Request successful",
    "data": {
        "created_at": "<timestamp>",
        "end_date": "<timestamp>",
        "identifier": "<product_id>",
        "organization": {
            "name": "<organization_name>",
            "identifier": "<organization_id>"
        },
        "points": 0,
        "price": 0,
        "primary_color": "<hex_color>",
        "sale": 0,
        "sale_points": 0,
        "sale_price": 0.00,
        "sale_text": "<sale_text>",
        "show_subtitle": 0,
        "show_title": 0,
        "start_date": "<timestamp>",
        "stock": 0,
        "subtitle": "<subtitle>",
        "text_color": "<hex_color>",
        "thumbnail_url": "<url>",
        "title": "<title>",
        "updated_at": "<timestamp>",
        "use_start_and_end": 0,
        "use_stock": 0
    }
}

PUT/products/:identifier

Update a product

This endpoint allows you to modify a product.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    products.update
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string
    Description

    The identifier of the product.

Request body

  • Name
    title
    Type
    string
    Description

    The title of the product.

  • Name
    subtitle
    Type
    string
    Description

    The subtitle of the product.

  • Name
    organization_id
    Type
    string
    Description

    The identifier of the organization the product should be created for.

  • Name
    description
    Type
    string
    Description

    The description of the product.

  • Name
    thumbnail_url
    Type
    string|url
    Description

    A valid url to the thumbnail image of the product.

  • Name
    show_title
    Type
    boolean
    Description

    whether or not to show the title of the product.

  • Name
    show_subtitle
    Type
    boolean
    Description

    whether or not to show the subtitle of the product.

  • Name
    price
    Type
    float
    Description

    The webshop price of the product.

  • Name
    points
    Type
    integer
    Description

    The webshop amount of points the product should cost.

  • Name
    use_stock
    Type
    boolean
    Description

    whether or not the product makes use of stock.

  • Name
    stock
    Type
    integer
    Description

    The amount of stock the product has.

  • Name
    use_start_and_end
    Type
    boolean
    Description

    whether or not the product makes use of start and end dates.

  • Name
    sale
    Type
    boolean
    Description

    whether or not the product is on sale.

  • Name
    sale_price
    Type
    float
    Description

    The sale price of the product.

  • Name
    sale_points
    Type
    integer
    Description

    The sale amount of points the product should cost.

  • Name
    sale_text
    Type
    string
    Description

    The sale text of the product.

  • Name
    start_date
    Type
    timestamp
    Description

    The start date of the product.

  • Name
    end_date
    Type
    timestamp
    Description

    The end date of the product.

Request

PUT
/products/:identifier
curl -X PUT https://api.walletapp.co/products/:identifier
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"
-d '{
    "title":"<title>",
    "subtitle":"<subtitle>",
    "description":"<description>",
    "organization_id":"<organization_id>",
    "thumbnail_url":"<image_url>",
    "show_title": true,
    "price": 12.50,
    "primary_color":"#ff00ff",
    "text_color":"#0000ff",
    "show_subtitle":true,
    "points": 123,
    "use_stock":true,
    "use_start_and_end": true,
    "sale": true,
    "sale_text": "<sale_text>",
    "sale_price":12.50,
    "sale_points":12,
    "stock":12,
    "start_date":"2022-01-01",
    "end_date":"2023-01-01"
}'

Response

{
"message": "Request successful",
"data": {
    "created_at": "<timestamp>",
    "end_date": "<timestamp>",
    "identifier": "<product_id>",
    "organization": {
        "name": "<organization_name>",
        "identifier": "<organization_id>"
    },
    "points": 0,
    "price": 0,
    "primary_color": "<hex_color>",
    "sale": 0,
    "sale_points": 0,
    "sale_price": 0.00,
    "sale_text": "<sale_text>",
    "show_subtitle": 0,
    "show_title": 0,
    "start_date": "<timestamp>",
    "stock": 0,
    "subtitle": "<subtitle>",
    "text_color": "<hex_color>",
    "thumbnail_url": "<url>",
    "title": "<title>",
    "updated_at": "<timestamp>",
    "use_start_and_end": 0,
    "use_stock": 0
}
}

DELETE/products/:identifier

Delete a product

The endpoint allows you to delete a product.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    products.delete
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string
    Description

    The id of the product you want to update.

Request

DELETE
/products/:identifier
curl -X delete https://api.walletapp.co/products/:identifier
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"

Response

{
    "message": "Request successful",
    "data": "Product archived",
}

PATCH/products/:identifier

Restore a product

The endpoint allows you to restore a product.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    products.delete
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string
    Description

    The id of the product you want to update.

Request

PATCH
/products/:identifier
curl -X PATCH https://api.walletapp.co/products/:identifier
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"

Response

{
    "message": "Request successful",
    "data": "Product restored",
}