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.
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
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>"
}
}
]
}
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
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>"
}
}
}
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
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>"
}
}
}
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
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>"
}
}
}
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
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"
}
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
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"
}