Skip to content

Grant a member one business card

POST/v1/businesses/{id}/memberships/{membershipId}/card-grants

Requires an API client bearer token.

Grants the member the right to hold one business card, until valid_until when given (else until revoked). The grant is created only after a sanctions screening of the person comes back clear: the screening_subject's given and family names, joined by one space, must be the member's full name (after Unicode NFKC, case folding and whitespace collapsing), else 409 screening_subject_mismatch and no screening; a result of candidates or confirmed_match is 409 screening_not_clear, carrying that result as screening_result; an unreachable or unconfigured screening service is 503, and no grant is created. The subject is not stored: the grant keeps the screening_id, and the Idempotency-Key keeps a keyed fingerprint (HMAC-SHA-256) of the whole request, retained with the key's stored outcome, so a reused key with a different body is 409. The business must be active (409 business_disabled, business_closed) and the membership active with can_hold_card (409 member_not_eligible); valid_until must be in the future (400 valid_until_not_future). Requires an Idempotency-Key: a retry replays the grant without screening again, and a screening_not_clear refusal is equally the key's stored answer, replayed on every retry under it; a request after the screening is dispositioned needs a new Idempotency-Key. Emits card_grant.created. An API client names its acting person in X-Rigid-Acting-Person (400 acting_person_required without it); the person needs an active membership of the business with can_grant_cards, else 403 acting_person_not_permitted. Every call the route decides (the release flag on, a well-formed body, and a valid Idempotency-Key not already used with a different body), allowed or refused, writes one audit intent with the API client, the asserted person, the business and the decision; a replay of a stored outcome writes none, and neither does a 5xx. A concurrent first attempt under the same Idempotency-Key that is still screening answers 429 idempotency_in_progress (transient: wait Retry-After and retry unchanged, never a fresh attempt). While the `business-cards` release flag is off for the caller's mode this route answers 404 to every authenticated, well-formed request not replaying an outcome stored while it was on, as if absent.

Parameters

Path parameters

NameRequiredDescription
idrequired
membershipIdrequired

Header parameters

NameRequiredDescription
Idempotency-Keyrequired

Client-chosen. An identical retry with the same key returns the stored response; reusing the key with a different payload returns 409.

X-Rigid-Acting-Personoptional

Request body

valid_untilstring (date-time)
screening_subjectobjectrequired
+ show properties
given_namestringrequired
family_namestringrequired
date_of_birthstring
nationalitystring

Example

curl -X POST https://api.rigid.fi/v1/businesses/{id}/memberships/{membershipId}/card-grants \
  -H "Authorization: Bearer $RIGID_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "screening_subject": {
    "given_name": "string",
    "family_name": "string"
  }
}'

Responses

201

The grant.

idstring (uuid)required
business_idstring (uuid)required
membership_idstring (uuid)required
state"active" | "revoked" | "expired"required
valid_fromstring (date-time)required
valid_untilstring (date-time) | nullrequired
screening_idstringrequired
card_idstring (uuid) | nullrequired
ends_atstring (date-time) | nullrequired
ended_atstring (date-time) | nullrequired
end_reasonone ofrequired
+ show properties

One of

Option 1

{
  "type": "string",
  "enum": [
    "revoked",
    "expired",
    "membership_removed",
    "business_closed"
  ]
}

Option 2

{
  "type": "null"
}

Option 3

{
  "type": "null"
}
created_atstring (date-time)required
400

Validation error, including valid_until_not_future and acting_person_required

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
401

Authentication required

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
403

The acting person is not permitted; admin_kyc_not_complete

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
404

Business or membership not found, or the business routes are not released

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
409

Idempotency-Key reused with a different payload; business_disabled; business_closed; member_not_eligible; screening_subject_mismatch; screening_not_clear, with screening_result (candidates or confirmed_match), the stored answer of its Idempotency-Key: a retry after the screening is dispositioned needs a new key

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
429

idempotency_in_progress: a concurrent first attempt under this key is screening now; wait Retry-After and retry unchanged

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
500

Internal server error

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
503

screening_unavailable or screening_unconfigured: no grant is created

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring