Create an organization location
const url = 'https://apisandbox.puurk.com/organizations/example/locations';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://apisandbox.puurk.com/organizations/example/locations \ --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" }'Creates a location. The organization’s first location is always primary, so a turnkey setup needs one call rather than two. Creating a later one with is_primary true moves the flag off every other location.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Organization ID
Request Bodyrequired
Section titled “Request Bodyrequired”Location fields
Body for POST /organizations/{oid}/locations. The six required fields must each be a non-empty string; the rest are optional. oid and id come from the path, and every other field — including photo_url and email_verified — is silently ignored rather than rejected.
The organization’s first location is always primary, so is_primary can be omitted. Sending is_primary false on the first location is a 400 rather than a silent override.
object
Two-letter US state or territory code. Accepted in any case and stored upper-cased — ca is read back as CA.
Example
TX12345 or 12345-6789
Example
78701Decimal fraction between 0 and 1 — 0.0825 for 8.25%, not 8.25.
Example
0.0825Responses
Section titled “Responses”Location created
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
Unique identifier for the location
Organization ID
External identifier
Two-letter US state or territory code. Accepted in any case on a write and stored upper-cased — ca is read back as CA.
12345 or 12345-6789
Exactly one location per organization is primary. The first location created is primary automatically.
Decimal fraction between 0 and 1 — 0.0825 for 8.25%, not 8.25.
Set by Puurk; never accepted from a request body.
Set by Puurk; never accepted from a request body.
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. One of: a non-object body; a string field that is not a string; an invalid state, zip, sales_tax_rate or is_primary; a required field that is missing, null or blank (Missing required field: <field> — an empty body reports name); or is_primary false on the organization’s first location, which is rejected rather than silently overridden.
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
Machine-readable error code.
Human-readable detail.
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.
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
Machine-readable error code.
Human-readable detail.
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 does not exist.
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
Machine-readable error code.
Human-readable detail.
Example
{ "error": "merchant_account_missing", "message": "The organization has no merchant account. Complete Stripe Connect onboarding for this organization before generating pricing."}