Skip to main content

Accept Team Invitation

Accepts an invitation to join a merchant's team.

No authentication required. Uses invitation token.

POST /api/invitations/accept

Request Body

FieldTypeRequiredDescription
tokenStringYesThe invitation token (from the invitation link).
firstNameStringConditionalRequired if user doesn't already exist. First name of the new user.
lastNameStringConditionalRequired if user doesn't already exist. Last name of the new user.
passwordStringConditionalRequired if user doesn't already exist. Password for the new account (min 8 characters).

Example Request (New User)

{
"token": "abc123xyz456...",
"firstName": "Jane",
"lastName": "Doe",
"password": "securePassword123"
}

Example Request (Existing User)

{
"token": "abc123xyz456..."
}

Response 200 OK

Returns details about the newly created team membership.

{
"message": "Invitation accepted successfully. You are now part of the team.",
"membership": {
"id": "uuid-membership-123",
"userId": "uuid-user-456",
"merchantId": "uuid-merchant-789",
"role": "DEVELOPER",
"createdAt": "2023-10-27T12:00:00.000Z"
}
}

Errors

  • 400 Bad Request: Invalid token, token expired, or missing required fields for new user.
  • 500 Internal Server Error