Elixir client for the Apple Business Registry API.
The public surface is intentionally small:
AppleBusinessRegistry.list_businesses()
AppleBusinessRegistry.get_business("business_id")
AppleBusinessRegistry.create_business(%{name: "Acme Inc", ...})
AppleBusinessRegistry.update_business("business_id", %{name: "Acme Corp", ...})
AppleBusinessRegistry.delete_business("business_id")
AppleBusinessRegistry.list_locations("business_id")
AppleBusinessRegistry.get_location("business_id", "location_id")
AppleBusinessRegistry.token()Configuration
config :apple_business_registry,
team_id: System.get_env("APPLE_TEAM_ID"),
key_id: System.get_env("BUSINESS_REGISTRY_KEY_ID"),
private_key: System.get_env("BUSINESS_REGISTRY_PRIVATE_KEY"),
base_url: "https://businessregistry.apple.com",
token_ttl_seconds: 300Every function also accepts per-call opts that override the application config.
Summary
Functions
Create a new business registration.
Create a new location for a business.
Delete a business registration.
Delete a location.
Get details for a specific business.
Get details for a specific location.
List all businesses registered to your team.
List all locations for a business.
Search for businesses by name, phone, or other criteria.
Return a cached-per-call Apple Business Registry access token (after the JWT → token exchange).
Update an existing business registration.
Update an existing location.
Validate a business registration before creating it.
Validate a location before creating it.
Types
Functions
Create a new business registration.
Parameters
attrs: Map of business attributes including:name(required): Business nameorganization_type: Organization type (e.g., "company", "nonprofit")primary_phone: Primary contact phone numberprimary_email: Primary contact emailwebsite: Business website URLdescription: Business description
Examples
AppleBusinessRegistry.create_business(%{
name: "Acme Inc",
organization_type: "company",
primary_phone: "+1-555-123-4567",
primary_email: "contact@acme.com"
})
Create a new location for a business.
Parameters
business_id: The unique identifier of the businessattrs: Map of location attributes including:name(required): Location nameaddress(required): Street addresslocality: City/localityadministrative_area: State/provincepostal_code: Postal codecountry: ISO country codephone: Location phone numberlatitude: Latitude coordinatelongitude: Longitude coordinate
Examples
AppleBusinessRegistry.create_location("biz_123", %{
name: "Acme HQ",
address: "1 Infinite Loop",
locality: "Cupertino",
administrative_area: "CA",
postal_code: "95014",
country: "US",
latitude: 37.3318,
longitude: -122.0312
})
Delete a business registration.
Parameters
business_id: The unique identifier of the business to delete
Delete a location.
Parameters
business_id: The unique identifier of the businesslocation_id: The unique identifier of the location to delete
Get details for a specific business.
Parameters
business_id: The unique identifier of the business
Get details for a specific location.
Parameters
business_id: The unique identifier of the businesslocation_id: The unique identifier of the location
List all businesses registered to your team.
Returns a list of business maps. Use decode: true to get Business structs.
List all locations for a business.
Parameters
business_id: The unique identifier of the business
Returns a list of location maps. Use decode: true to get Location structs.
Search for businesses by name, phone, or other criteria.
Parameters
query: Search query stringopts: Optional search parameters::filters: Map of filter criteria (e.g.,%{country: "US"})
Examples
AppleBusinessRegistry.search_businesses("coffee", filters: %{country: "US", locality: "San Francisco"})
Return a cached-per-call Apple Business Registry access token (after the JWT → token exchange).
Update an existing business registration.
Parameters
business_id: The unique identifier of the businessattrs: Map of business attributes to update
Update an existing location.
Parameters
business_id: The unique identifier of the businesslocation_id: The unique identifier of the locationattrs: Map of location attributes to update
Validate a business registration before creating it.
Parameters
attrs: Map of business attributes to validate
Returns {:ok, validation_result} if validation passes, or {:error, reason} if it fails.
Validate a location before creating it.
Parameters
attrs: Map of location attributes to validate
Returns {:ok, validation_result} if validation passes, or {:error, reason} if it fails.