Brands

Brands are one of the ways you can brand your organization. Once a member signs up they will be associated with that specific brand.

The brand model

The brand model contains information about styling, branding and extra information which can be usefull for webshops. The following properties are available:

Properties

  • Name
    name
    Type
    string
    Description

    The name of the brand.

  • Name
    identifier
    Type
    string
    Description

    Unique identifier for the brand.

  • Name
    logo
    Type
    string|url
    Description

    A valid url to the logo of the brand.

  • Name
    primary_color
    Type
    string
    Description

    The primary color of the brand.

  • Name
    second_color
    Type
    string
    Description

    The secondary color of the brand.

  • Name
    third_color
    Type
    string
    Description

    An third color mainly used for styling buttons.

  • Name
    organization
    Type
    object
    Description

    An object containing the organization the brand belongs to, contains: ['name', 'identifier'].

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/brands

List all brands

This endpoints returns a list of all the brands the currently authenticated user has access to.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    brands.get
    Type
    string
    Description

    The scope required to access this endpoint.

Request

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

Response

{
"message": "Request successful",
"data": [
    {
        "name": "<brand_name>",
        "logo": "<logo_url>",
        "identifier": "<identifier>",
        "primary_color": "#ffffff",
        "second_color": "#000000",
        "third_color": "#000000",
        "organization": {
            "name": "<organization_name>",
            "identifier": "<organization_id>"
        }
    },
    ...
]
}

POST/brands

Create a brand

This endpoint allows you to create a brand.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    brands.store
    Type
    string
    Description

    The scope required to access this endpoint.

Request body

  • Name
    organization_id
    Type
    string|Required
    Description

    The organization id the brand belongs to.

  • Name
    name
    Type
    string|Required
    Description

    The name of the brand.

  • Name
    primary_color
    Type
    string|Required
    Description

    The primary color of the brand.

  • Name
    second_color
    Type
    string|Required
    Description

    The secondary color of the brand.

  • Name
    third_color
    Type
    string|Required
    Description

    An third color mainly used for styling buttons.

  • Name
    logo
    Type
    string|url|Required
    Description

    A valid url to the logo of the brand.

Request

POST
/brands
curl -X POST https://api.walletapp.co/brands 
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"
-d '{
    "organization_id":"<organization_id>",
    "name":"<brand_name>",
    "primary_color":"#fff000",
    "second_color":"#00ff00",
    "third_color":"#0000ff",
    "logo":"<url_to_logo>"
}'

Response

{
    "message": "Request successful",
    "data": {
        "name": "<brand_name>",
        "logo": "<logo_url>",
        "organization": {
            "name": "<organization_name>",
            "identifier": "<organization_id>"
        },
        "identifier": "<brand_id>",
        "primary_color": "#fff000",
        "second_color": "#00ff00",
        "third_color": "#0000ff"
    }
}

GET/brands/:identifier

Inspect a brand

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

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    brands.get
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string
    Description

    The id of the brand you want to update.

Request

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

Response

{
    "message": "Request successful",
    "data": {
        "name": "<brand_name>",
        "logo": "<logo_url>",
        "organization": {
            "name": "<organization_name>",
            "identifier": "<organization_id>"
        },
        "identifier": "<brand_id>",
        "primary_color": "#fff000",
        "second_color": "#00ff00",
        "third_color": "#0000ff"
    }
}

PUT/brands/:identifier

Update a brand

The endpoint allows you to modify a brand

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    brands.update
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string
    Description

    The id of the brand you want to update.

Request body

  • Name
    organization_id
    Type
    string
    Description

    The organization id the brand belongs to.

  • Name
    name
    Type
    string
    Description

    The name of the brand.

  • Name
    primary_color
    Type
    string
    Description

    The primary color of the brand.

  • Name
    second_color
    Type
    string
    Description

    The secondary color of the brand.

  • Name
    third_color
    Type
    string
    Description

    An third color mainly used for styling buttons.

  • Name
    logo
    Type
    string|url
    Description

    A valid url to the logo of the brand.

Request

PUT
/brands/:identifier
curl -X PUT https://api.walletapp.co/brands/:identifier
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"
-d '{
        "organization_id":"<organization_id>",
        "name":"<brand_name>",
        "primary_color":"#fff000",
        "second_color":"#00ff00",
        "third_color":"#0000ff",
        "logo":"<url_to_logo>"
    }'

Response

{
  "message": "Request successful",
  "data": {
      "name": "<brand_name>",
      "logo": "<logo_url>",
      "organization": {
          "name": "<organization_name>",
          "identifier": "<organization_id>"
      },
      "identifier": "<brand_id>",
      "primary_color": "#fff000",
      "second_color": "#00ff00",
      "third_color": "#0000ff"
  }
}

DELETE/brands/:identifier

Delete a brand

The endpoint allows you to delete a brand.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    brands.delete
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string
    Description

    The id of the brand you want to update.

Request

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

Response

{
    "message": "Request successful",
    "message": "Brand deleted",
}

PATCH/brands/:identifier

Restore a brand

The endpoint allows you to restore a brand.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    brands.delete
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string
    Description

    The id of the brand you want to update.

Request

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

Response

{
    "message": "Request successful",
    "message": "Brand restored",
}