Skip to content

Update an organization location

PATCH
/organizations/{oid}/locations/{lid}
curl --request PATCH \
--url https://apisandbox.puurk.com/organizations/example/locations/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "address_line_1": "example", "address_line_2": "example", "city": "example", "state": "TX", "zip": "78701", "phone_number": "example", "email_address": "example", "is_primary": true, "sales_tax_rate": 0.0825, "eid": "example" }'

Partial update. Setting is_primary true moves the primary flag off every other location. It cannot be set false on the location that is currently primary — promote another one instead.

oid
required
string

Organization ID

lid
required
string

Location ID

Fields to update

Media typeapplication/json

Body for PATCH /organizations/{oid}/locations/{lid}. Every field is optional, but at least one writable field must be present. Only the supplied fields are validated, and null clears a field — including one that is required on create (name, phone_number, address_line_1, city, state, zip). Clearing those, or setting name, phone_number, address_line_1 or city to "", is accepted but leaves an incomplete location, so avoid it.

oid and id come from the path, and every other field — including photo_url and email_verified — is silently ignored rather than rejected.

object
name
string
address_line_1
string
address_line_2
string
nullable
city
string
state

Two-letter US state or territory code. Accepted in any case and stored upper-cased — ca is read back as CA.

string
Example
TX
zip

12345 or 12345-6789

string
Example
78701
phone_number
string
email_address
string
nullable
is_primary
boolean
nullable
sales_tax_rate

Decimal fraction between 0 and 1 — 0.0825 for 8.25%, not 8.25.

number format: double
nullable
Example
0.0825
eid
string
nullable

Location updated

Media typeapplication/json

A physical location of an organization. Onboarding reads the primary location: business_profile_complete needs ein, a logo and a location with is_primary true, and sales_tax_set needs sales_tax_rate on that location.

Every property is nullable — a location written before these endpoints existed may be missing any of them.

object
id

Unique identifier for the location

string
nullable
oid

Organization ID

string
nullable
eid

External identifier

string
nullable
name
string
nullable
address_line_1
string
nullable
address_line_2
string
nullable
city
string
nullable
state

Two-letter US state or territory code. Accepted in any case on a write and stored upper-cased — ca is read back as CA.

string
nullable
zip

12345 or 12345-6789

string
nullable
phone_number
string
nullable
email_address
string
nullable
is_primary

Exactly one location per organization is primary. The first location created is primary automatically.

boolean
nullable
sales_tax_rate

Decimal fraction between 0 and 1 — 0.0825 for 8.25%, not 8.25.

number format: double
nullable
photo_url

Set by Puurk; never accepted from a request body.

string
nullable
email_verified

Set by Puurk; never accepted from a request body.

boolean
nullable
Example
{
"name": "Main Street",
"address_line_1": "1 Main St",
"address_line_2": "Suite 200",
"city": "Austin",
"state": "TX",
"zip": "78701",
"phone_number": "5125551234",
"email_address": "main@example.com",
"sales_tax_rate": 0.0825
}

bad_request — a non-object body, a validation failure on a supplied field, or no writable field supplied (No valid fields to update).

Media typeapplication/json

The standard error body. error is a stable, machine-readable code — branch on it rather than on message, which is for humans and may change.

object
error

Machine-readable error code.

string
message

Human-readable detail.

string
Example
{
"error": "merchant_account_missing",
"message": "The organization has no merchant account. Complete Stripe Connect onboarding for this organization before generating pricing."
}

Unauthorized

forbidden — the token lacks the write action on organizations for this organization. Scope is checked before existence, so an unauthorized caller gets this rather than a 404.

Media typeapplication/json

The standard error body. error is a stable, machine-readable code — branch on it rather than on message, which is for humans and may change.

object
error

Machine-readable error code.

string
message

Human-readable detail.

string
Example
{
"error": "merchant_account_missing",
"message": "The organization has no merchant account. Complete Stripe Connect onboarding for this organization before generating pricing."
}

not_found — the organization or location does not exist.

Media typeapplication/json

The standard error body. error is a stable, machine-readable code — branch on it rather than on message, which is for humans and may change.

object
error

Machine-readable error code.

string
message

Human-readable detail.

string
Example
{
"error": "merchant_account_missing",
"message": "The organization has no merchant account. Complete Stripe Connect onboarding for this organization before generating pricing."
}

conflict — is_primary cannot be cleared on the current primary location.

Media typeapplication/json

The standard error body. error is a stable, machine-readable code — branch on it rather than on message, which is for humans and may change.

object
error

Machine-readable error code.

string
message

Human-readable detail.

string
Example
{
"error": "merchant_account_missing",
"message": "The organization has no merchant account. Complete Stripe Connect onboarding for this organization before generating pricing."
}