Offers

Sponsor offers are a type of product that can be placed in the webshop. It has no price but can be seen as an extra banner spot in your webshop with a redirect to another website or page.

The sponsoroffer model

The sponsoroffer model contains the information about an offer itself. The following properties are available:

Properties

  • Name
    title
    Type
    string
    Description

    The title of the offer.

  • Name
    subtitle
    Type
    string
    Description

    The subtitle of the offer.

  • Name
    organization
    Type
    object
    Description

    The organization object that belongs to the offer, contains: ['identifier', 'name']

  • Name
    thumbnail_url
    Type
    string|url
    Description

    A valid url to the thumbnail image of a offer.

  • Name
    primary_color
    Type
    string
    Description

    The primary color of the offer.

  • Name
    text_color
    Type
    string
    Description

    The text color of the offer.

  • Name
    sponsor_url
    Type
    string|url
    Description

    A valid url to the sponsor website.

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

List all offers

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

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    offers.get
    Type
    string
    Description

    The scope required to access this endpoint.

Request

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

Response

{
"message":  "Request successful",
"data": [
    {
        "title": "<title>",
        "sponsor_url": "<sponsor_url>",
        "description": "<description>",
        "identifier": "<identifier>",
        "subtitle": "<subtitle>",
        "primary_color": "#ff00ff",
        "text_color": "#0000ff",
        "thumbnail_url": "<url_to_image>",
        "organization": {
            "name": "<organization_name>",
            "identifier": "<organization_id>"
        }
    },
    ...
],
}

POST/offers

Create a offer

This endpoint allows you to create a offer.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    offers.store
    Type
    string
    Description

    The scope required to access this endpoint.

Request body

  • Name
    title
    Type
    string|Required
    Description

    The title of the offer.

  • Name
    subtitle
    Type
    string|Required
    Description

    The subtitle of the offer.

  • Name
    organization_id
    Type
    string|Required
    Description

    The organization id the offer should be created for.

  • Name
    sponsor_url
    Type
    string|Required
    Description

    The URL the offer redirects to on click.

  • Name
    description
    Type
    string
    Description

    The description of the offer.

  • Name
    thumbnail_url
    Type
    string|url
    Description

    A valid url to the thumbnail image of a offer.

  • Name
    primary_color
    Type
    string
    Description

    A Hexadecimal color code for the primary color of the offer (background color for the apple wallet pass).

  • Name
    text_color
    Type
    string
    Description

    A Hexadecimal color code for the text color of the offer (text color for the apple wallet pass).

Request

POST
/offers
curl -X POST https://api.walletapp.co/offers 
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"
-d '{
    "title":"<title>",
    "subtitle":"<subtitle>",
    "description":"<description>",
    "sponsor_url": "<sponsor_url>",
    "organization_id":"<organization_id>",
    "thumbnail_url":"<url_to_image>",
    "primary_color":"#ff00ff",
    "text_color":"#0000ff"
}'

Response

{
    "message":  "Request successful",
    "data": {
        "title": "<title>",
        "sponsor_url": "<sponsor_url>",
        "description": "<description>",
        "identifier": "<identifier>",
        "subtitle": "<subtitle>",
        "primary_color": "#ff00ff",
        "text_color": "#0000ff",
        "thumbnail_url": "<url_to_image>",
        "organization": {
            "name": "<organization_name>",
            "identifier": "<organization_id>"
        }
    }
}


GET/offers/:identifier

Inspect a offer

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

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    offers.get
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string
    Description

    The id of the offer you want to update.

Request

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

Response

   {
    "message":  "Request successful",
    "data": {
        "title": "<title>",
        "sponsor_url": "<sponsor_url>",
        "description": "<description>",
        "identifier": "<identifier>",
        "subtitle": "<subtitle>",
        "primary_color": "#ff00ff",
        "text_color": "#0000ff",
        "thumbnail_url": "<url_to_image>",
        "organization": {
            "name": "<organization_name>",
            "identifier": "<organization_id>"
        }
    }
}

PUT/offers/:identifier

Update a offer

This endpoint allows you to modify a offer.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    offers.update
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string
    Description

    The id of the offer you want to update.

Request body

  • Name
    title
    Type
    string|Required
    Description

    The title of the offer.

  • Name
    subtitle
    Type
    string|Required
    Description

    The subtitle of the offer.

  • Name
    organization_id
    Type
    string|Required
    Description

    The organization id the offer should be created for.

  • Name
    sponsor_url
    Type
    string|Required
    Description

    The URL the offer redirects to on click.

  • Name
    description
    Type
    string
    Description

    The description of the offer.

  • Name
    thumbnail_url
    Type
    string|url
    Description

    A valid url to the thumbnail image of a offer.

  • Name
    primary_color
    Type
    string
    Description

    A Hexadecimal color code for the primary color of the offer (background color for the apple wallet pass).

  • Name
    text_color
    Type
    string
    Description

    A Hexadecimal color code for the text color of the offer (text color for the apple wallet pass).

Request

PUT
/offers/:identifier
curl -X PUT https://api.walletapp.co/offers/:identifier
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"
-d '{
        "title":"<title>",
        "subtitle":"<subtitle>",
        "description":"<description>",
        "sponsor_url": "<sponsor_url>",
        "organization_id":"<organization_id>",
        "thumbnail_url":"<url_to_image>",
        "primary_color":"#ff00ff",
        "text_color":"#0000ff"
    }'

Response

{
    "message":  "Request successful",
    "data": {
        "title": "<title>",
        "sponsor_url": "<sponsor_url>",
        "description": "<description>",
        "identifier": "<identifier>",
        "subtitle": "<subtitle>",
        "primary_color": "#ff00ff",
        "text_color": "#0000ff",
        "thumbnail_url": "<url_to_image>",
        "organization": {
            "name": "<organization_name>",
            "identifier": "<organization_id>"
        }
    }
}

DELETE/offers/:identifier

Delete a offer

The endpoint allows you to delete a offer.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    offers.delete
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string
    Description

    The id of the offer you want to update.

Request

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

Response

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

PATCH/offers/:identifier

Restore a offer

The endpoint allows you to restore a offer.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    offers.delete
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string
    Description

    The id of the offer you want to update.

Request

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

Response

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