Skip to main content

Locations

Locations

This object represents a location as a core data entity within the system. It serves as a unique identifier for each service provider and is foundational for associating items in the system.

Insert or update (upsert) a Location

Uniqueness is determined based on a combination of the account unique identifier and the external ID. If a record with the same account unique identifier and external unique identifier already exists, the existing record will be updated. Otherwise, a new record will be created.

New data is merged with existing data. See clarification below for details.

Parameters

account_unique_identifier
Requiredstring

The unique identifier of the account. See Accounts for more information.

external_identifier
Requiredstring

The external identifier of this location, to enforce uniqueness. This is the identifier of the location in your system.

location_name
Requiredstring

The name of the location.

Returns

A dictionary representing the created or updated location object.

POST
/v1/locations/upsert
curl -X POST https://api.mogulbridge.com/v1/locations/upsert \
-u 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: \
-d account_unique_identifier='acct_GYtjmDNf2raFHTBX' \
-d external_identifier='your-external-identifier' \
-d location_name='Example Funeral Home'
RESPONSE
{
  "object": "location",
  "unique_identifier": "loc_SE9g1uGPTLUcPpxVBtdnl",
  "location_name": "Example Funeral Home",
  "inserted_at": "2023-11-13T23:20:31Z",
  "updated_at": "2023-11-13T23:20:31Z",
  "public_data": {},
  "external_identifier": "your-external-identifier",
  "account_unique_identifier": "acct_GYtjmDNf2raFHTBX"
}

List all locations

Returns a list of locations you have access to. The locations are returned sorted alphabetically by name.

Parameters

limit
(optional)integer

Limits the number of locations returned.

Returns

A dictionary with a data property that contains an array of up to limit locations. Each entry in the array is a separate location object. If no more locations are available, the resulting array will be empty.

GET
/v1/locations
curl -G https://api.mogulbridge.com/v1/locations \
-u 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: \
-d limit=100
RESPONSE
{
  "object": "list",
  "url": "/v1/locations",
  "data": [
    {
      "unique_identifier": "loc_XFRitug2hXD3ESq6NXRfo",
      "inserted_at": "2023-11-13T23:13:25Z",
      "updated_at": "2023-11-13T23:13:25Z",
      "name": "Demo Funeral Home",
      "public_data": {}
    }
  ]
}