Skip to main content

Invite Team Member

Sends an invitation to join a merchant's team to the specified email address.

Authentication required (User JWT).

POST /api/merchants/:merchantId/team/invitations

Path Parameters​

ParameterTypeDescription
merchantIdStringThe ID of the parent merchant.

Request Body​

FieldTypeRequiredDescription
emailStringYesEmail address of the person to invite.
roleStringYesRole to assign to the team member (ADMIN, DEVELOPER, SUPPORT, VIEW_ONLY).

Example Request​

{
"email": "team.member@example.com",
"role": "DEVELOPER"
}

Response 201 Created​

Returns the invitation details.

{
"message": "Invitation sent successfully",
"invitation": {
"id": "uuid-invitation-123",
"merchantId": "uuid-merchant-456",
"email": "team.member@example.com",
"role": "DEVELOPER",
"status": "PENDING",
"expiresAt": "2023-11-03T12:00:00.000Z",
"invitedByUserId": "uuid-user-789",
"createdAt": "2023-10-27T12:00:00.000Z"
}
}

Errors​

  • 400 Bad Request: Validation failed (missing fields, invalid role).
  • 401 Unauthorized: Invalid or missing JWT.
  • 403 Forbidden: User does not have permission to invite team members.
  • 404 Not Found: Merchant not found.
  • 409 Conflict: User is already a member or already has a pending invitation.
  • 500 Internal Server Error