user_invitation
Collection: user_invitations
Invitation for a user to access a certain store. The payload for a POST request should include the invitee's email, which cannot match an existing email for the store, and the scope to give them. To resend an invitation, use the fx:resend link rel.
Only the invited user can accept or reject an invitation, and they leave a store by revoking their accepted one; only the store revokes a pending invitation.
Changing the scope of a user who has access is refused while integrations they created for the store need more access than the new scope gives, or while they have integrations and the new scope drops integrations_write; the error names those integrations. An allowed change keeps their integrations and ends their sign-in sessions for the store, so the new scope applies when they next sign in.
Notes
Permissions depend on who is acting. The store manages its invitations with a token for that store holding user_invitations_*. The invited user reads and answers their own invitation with users_*, from any store:
- Reading, creating, updating (
PATCH) and resending an invitation, revoking asentoracceptedone, and deleting arevokedorexpiredone requireuser_invitations_read/user_invitations_writeon the invitation's store. - The invited user can read their invitation with
users_read, and withusers_writeaccept or reject it, revoke it onceacceptedto leave the store, and delete it oncerejected,revokedorexpired.store_full_accessdoes not grant these actions — the authenticated user must be the invitee.
See the Scopes guide for the full endpoint-by-endpoint breakdown.
Required Scopes How scopes work →
store_full_access When the store manages the invitation:
user_invitations_write When the invited user reads or answers it:
users_read users_write Actions
Properties (11)
store_url String · Read-only URL of the store that the user is invited to.
store_name String · Read-only Name of the store that the user is invited to.
store_email String · Read-only Email of the store that the user is invited to.
store_domain String · Read-only Domain of the store that the user is invited to.
first_name String First name of the user.
last_name String Last name of the user.
email String · Required Email of the user. It can't be changed after the invitation has been created.
scope String A space-separated list of the store permission scopes the user will have, such as store_full_access or transactions_read customers_write. It can't include client scopes, or any scope the token making the request doesn't cover itself. Only the store's managers can change it, and only the user who sent an invitation can change it while it is still sent.
Required when creating an invitation, unless the token making the request has store_full_access; an invitation without one gives full access.
status String · Read-only Status of the invitation.
sentacceptedrejectedrevokedexpired date_created String (nullable) · Read-only The date this resource was created.
date_modified String (nullable) · Read-only The date this resource was last modified.
Link Relations (7)
self This User Invitation fx:accept POST Accept this user invitation. Only present for the invited user while the invitation is sent. Requires users_write; store_full_access does not grant it.
fx:reject POST Reject this user invitation. Only present for the invited user while the invitation is sent. Requires users_write; store_full_access does not grant it.
fx:revoke POST Revoke this user invitation. When the invited user revokes their accepted invitation, they leave the store. Only present for the store (user_invitations_write) while the invitation is sent or accepted, or for the invited user once it is accepted.
fx:resend POST Resend the email for this invitation. Only present for the store (user_invitations_write) while the invitation is sent.
Only present once the invitation is linked to a user.
Example Representation
{
"_links": {
"curies": [
{
"name": "fx",
"href": "https://api.foxycart.com/rels/{rel}",
"templated": true
}
],
"self": {
"href": "https://api.foxycart.com/user_invitations/123",
"title": "This User Invitation"
},
"fx:store": {
"href": "https://api.foxycart.com/stores/456",
"title": "This Store"
}
},
"store_url": "http://www.example.com/",
"store_name": "Example Store",
"store_email": "john@example.com",
"store_domain": "example",
"first_name": "Mary",
"last_name": "Smith",
"email": "mary@example.com",
"scope": "transactions_read customers_write",
"status": "sent",
"date_created": "2022-12-01T10:07:05-0800",
"date_modified": "2022-12-01T10:07:05-0800"
}