/external-memberships/-actions/upsert-with-customer

Atomically find or create a customer and upsert an external membership in one call. external_id is the source of truth: if it already exists, the customer that owns it is used, their first_name, last_name, birthdate (and sex, if sent) are updated from the request, and the membership is updated (200). Email and phone are never overwritten. If the external_id is on more than one customer → 409 with customer_ids. For a new external_id, matches on first_name + last_name + birthdate (+ email if provided), ignoring customers already linked to a different external_id: 1 match → creates the membership for that customer (201); 0 or 2+ matches → creates a new customer + membership (201). Concurrent requests for the same external_id are processed one at a time; if one waits too long → 503, retry. Status is automatically derived from expires_at: null/future → active, past → expired. Every save is recorded in the audit log (objectType = SIT_ExternalMembership).

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

Atomically find or create a customer and upsert an external membership in one call. external_id is the source of truth: if it already exists, the customer that owns it is used, their first_name, last_name, birthdate (and sex, if sent) are updated from the request, and the membership is updated (200). Email and phone are never overwritten. If the external_id is on more than one customer → 409 with customer_ids. For a new external_id, matches on first_name + last_name + birthdate (+ email if provided), ignoring customers already linked to a different external_id: 1 match → creates the membership for that customer (201); 0 or 2+ matches → creates a new customer + membership (201). Concurrent requests for the same external_id are processed one at a time; if one waits too long → 503, retry. Status is automatically derived from expires_at: null/future → active, past → expired. Every save is recorded in the audit log (objectType = SIT_ExternalMembership).

date
required

Customer's date of birth (YYYY-MM-DD).

string | null

Customer's email address. Optional but recommended — used as an additional matching signal to reduce false duplicates.

date-time | null

UTC ISO-8601 datetime when the membership expires. Omit or send null for no expiry (treated as active).

string
required

Bay Club's member ID.

string
required
length ≤ 50

Customer's first name.

string
required
length ≤ 50

Customer's last name.

string
enum
required

Provider type. Currently only "bayclub" is accepted.

Allowed:
string | null

Customer's daytime phone number.

string | null

Customer's mobile phone number.

string | null
enum

Customer's gender: m = male, f = female, o = non-binary. Optional — defaults to blank if not provided.

Allowed:
Responses
200

Existing customer found, membership upserted successfully.

201

New customer and/or membership created successfully.

503

Another request for the same external_id is still being processed. Retry shortly.

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/vnd.api+json