Locations

Locations are ment to represent your physical stores or locations.

The location model

The location model contains the following parameters

Properties

  • Name
    title
    Type
    string
    Description

    The title of the location.

  • Name
    house_number
    Type
    string
    Description

    The house number of the location.

  • Name
    address
    Type
    string
    Description

    The address of a location.

  • Name
    external_id
    Type
    string
    Description

    A reference to the location provided by the integrating party.

  • Name
    latitude
    Type
    float
    Description

    The latitude of a location.

  • Name
    longitude
    Type
    float
    Description

    The longitude of a location.

  • Name
    identifier
    Type
    string
    Description

    The unique identifier of a location.

  • Name
    brand
    Type
    object
    Description

    The brand of a location. contains [name, identifier]

Note

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


GET/locations

List all locations

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

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    locations.get
    Type
    string
    Description

    The scope required to access this endpoint.

Request

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

Response

{
    "success": true,
    "data": [
        {
            "title": "<title>",
            "house_number": "<house_number>",
            "address": "<address>",
            "latitude": 52.00000,
            "longitude": 4.4800
            "identifier": "<UUID>",
            "brand": {
                "name": "<title>",
                "identifier": "<UUID>"
            }
        }
    ]
}

POST/locations

Create a location

This endpoint allows you to create a location.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    locations.store
    Type
    string
    Description

    The scope required to access this endpoint.

Body parameters

  • Name
    brand_id
    Type
    string|required
    Description

    The id of the brand you want to create a location for.

  • Name
    title
    Type
    string|required
    Description

    The title of the location.

  • Name
    address
    Type
    string|Required
    Description

    The address of a location.

  • Name
    street
    Type
    string|Required
    Description

    The street of a location.

  • Name
    postcode
    Type
    string|Required
    Description

    The postcode of a location.

  • Name
    city
    Type
    string|Required
    Description

    The city of a location.

  • Name
    external_id
    Type
    string|Required
    Description

    A reference to the location provided by the integrating party.

  • Name
    house_number
    Type
    string
    Description

    The house number of the location.

  • Name
    latitude
    Type
    float
    Description

    The latitude of a location.

  • Name
    longitude
    Type
    float
    Description

    The longitude of a location.

Request

POST
/locations
curl -X POST https://api.walletapp.co/locations 
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"
-d '{
    "brand_id": "<brand_id>",
    "latitude": "<latitude>",
    "longitude": "<longitude>",
    "house_number": "<string>",
    "street": "<street>",
    "postcode": "<postcode>",
    "title": "<title>",
    "city": "<city>",
    "external_id": "<external_id>",
}'

Response

{
    "success": true,
    "data": {
        "title": "<title>",
        "house_number": "<house_number>",
        "address": "<address>",
        "latitude": 52.00000,
        "longitude": 4.4800
        "identifier": "<UUID>",
        "brand": {
            "name": "<title>",
            "identifier": "<UUID>"
        }
    }
}

PUT/locations/:identifier

Update a location

This endpoint allows you to create a location.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    locations.update
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string
    Description

    The identifier of the location you want to update.

Body parameters

  • Name
    brand_id
    Type
    string|required
    Description

    The id of the brand you want to create a location for.

  • Name
    title
    Type
    string
    Description

    The title of the location.

  • Name
    address
    Type
    string
    Description

    The address of a location.

  • Name
    street
    Type
    string|Required
    Description

    The street of a location.

  • Name
    postcode
    Type
    string|Required
    Description

    The postcode of a location.

  • Name
    city
    Type
    string|Required
    Description

    The city of a location.

  • Name
    external_id
    Type
    string
    Description

    A reference to the location provided by the integrating party.

  • Name
    house_number
    Type
    string
    Description

    The house number of the location.

  • Name
    latitude
    Type
    float
    Description

    The latitude of a location.

  • Name
    longitude
    Type
    float
    Description

    The longitude of a location.

Request

PUT
/locations/:identifier
curl -X PUT https://api.walletapp.co/locations/:identifier 
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"
-d '{
    "brand_id": "<brand_id>",
    "latitude": "<latitude>",
    "longitude": "<longitude>",
    "house_number": "<string>",
    "street": "<street>",
    "postcode": "<postcode>",
    "title": "<title>",
    "city": "<city>",
    "external_id": "<external_id>",
}'

Response

{
    "success": true,
    "data": {
        "title": "<title>",
        "house_number": "<house_number>",
        "address": "<address>",
        "latitude": 52.00000,
        "longitude": 4.4800
        "identifier": "<UUID>",
        "brand": {
            "name": "<title>",
            "identifier": "<UUID>"
        }
    }
}

GET/locations/:identifier

Inspect a location

This endpoint allows you to inspect a location.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    locations.get
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string
    Description

    The identifier of the location.

Request

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

Response

    {
        "success": true,
        "data": {
            "title": "<title>",
            "house_number": "<house_number>",
            "address": "<address>",
            "latitude": 52.00000,
            "longitude": 4.4800
            "identifier": "<UUID>",
            "brand": {
                "name": "<title>",
                "identifier": "<UUID>"
            }
        }
    }

DELETE/locations/:identifier

Archive a location

This endpoint allows you to archive a location.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    locations.delete
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string
    Description

    The identifier of the location.

Request

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

Response

{
    "success": true,
    "message": "location deleted"
}

PATCH/locations/:identifier

Restore a location

This endpoint allows you to restore a location.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    locations.delete
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string
    Description

    The identifier of the location.

Request

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

Response

{
    "success": true,
    "data": "location restored"
}