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 a sent or accepted one, and deleting a revoked or expired one require user_invitations_read / user_invitations_write on the invitation's store.
  • The invited user can read their invitation with users_read, and with users_write accept or reject it, revoke it once accepted to leave the store, and delete it once rejected, revoked or expired. store_full_access does 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 →

When the store manages the invitation:

When the invited user reads or answers it:

Read users_read
Write users_write

Actions

GET View a user invitation
PATCH Update a user invitation (send only the properties you want to modify)
DELETE Delete a rejected, revoked or expired user invitation
HEAD Get just the header response
OPTIONS Get a response explaining which HTTP methods are supported

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:store GET PATCH PUT DELETE This Store
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.

fx:user GET PATCH PUT DELETE This User.

Only present once the invitation is linked to a user.

https://api.foxycart.com/user_invitations/{id}

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"
}