- Get Started
- Product
- Build
- User Guide
- Cloud
- Get Started
- Product
- Build
- Tools
- Reference
- User Guide
- Cloud
This documentation provides a reference to the sdk.admin.invite
set of methods used to send requests to Medusa's Admin API routes.
This method accepts an invite. It requires sending a previous request to the Auth.register.
This method sends a request to the [Accept Invite] (https://docs.medusajs.com/api/admin#invites_postinvitesaccept) API route.
1await sdk.auth.register("user", "emailpass", {2 email: "user@gmail.com",3 password: "supersecret"4})5 6// all subsequent requests will use the token in the header7const { user } = await sdk.admin.invite.accept(8 {9 email: "user@gmail.com",10 first_name: "John",11 last_name: "Smith",12 invite_token: "12345..."13 },14)
input
AdminAcceptInvite & objectPromise
Promise<AdminAcceptInviteResponse>This method creates an invite. It sends a request to the Create Invite API route.
Promise
Promise<AdminInviteResponse>This method retrieves an invite by its ID. It sends a request to the Get Invite API route.
To retrieve an invite its ID:
To specify the fields and relations to retrieve:
Learn more about the fields
property in the API reference.
id
stringPromise
Promise<AdminInviteResponse>This method retrieves a paginated list of invites. It sends a request to the List Invites API route.
To retrieve the list of invites:
To configure the pagination, pass the limit
and offset
query parameters.
For example, to retrieve only 10 items and skip 10 items:
Using the fields
query parameter, you can specify the fields and relations to retrieve
in each invite:
Learn more about the fields
property in the API reference.
Promise
Promise<AdminInviteListResponse>This method refreshes the token of an invite. It sends a request to the Refresh Invite Token API route.
id
stringPromise
Promise<AdminInviteResponse>This method deletes an invite. It sends a request to the Delete Invite API route.
id
stringPromise
Promise<AdminInviteDeleteResponse>