Skip to main content

Update Invite Code

PUT 

/api/admin/portal/invite-codes/:inviteCode

Replace an invite code's settings. Takes the same body as Create Invite Code (send every field you want to keep). A blank code keeps the current code. max_uses cannot be set below the uses the code already has. Changes apply to future sign-ups only: accounts already created with the code are not changed.

Required scope: customers:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Body fields

  • code (string, optional, 4-40 characters): letters, numbers and dashes. It is trimmed and uppercased, and spaces become -. Blank or omitted generates a random XXXX-XXXX code (no 0, O, 1, I or L). Must not match any other code, archived ones included.
  • name (string, required, max 255): internal label.
  • target (required): new_account or existing_customer.
  • customer_id (integer): required when target is existing_customer; a non-archived customer.
  • joiner_role (optional): buyer (default), approver or viewer. Used only for existing_customer codes.
  • product_pricing_tier_id, payment_term_id, default_sales_rep_id, store_id (integer, optional, nullable): what a new_account code provisions; store_id must be a non-archived store.
  • credit_limit (number >= 0, optional, nullable).
  • portal_catalog_ids (array of catalog ids, optional, nullable).
  • allowed_email_domains (array of up to 50 domains, optional): e.g. acme.com or @acme.com. Stored lowercase without @.
  • approval_mode (optional): instant (default) or review.
  • expires_on (Y-m-d, optional, nullable): the code works until the end of this day in the tenant's timezone.
  • max_uses (integer >= 1, optional, nullable): null = unlimited.
  • welcome_message (string, optional, max 280): shown to the buyer when the code is accepted.
  • is_active (boolean, optional, default true).

For an existing_customer code the provisioning fields (product_pricing_tier_id, payment_term_id, credit_limit, portal_catalog_ids, default_sales_rep_id, store_id) are ignored and stored empty. For a new_account code, customer_id and joiner_role are ignored.

Request​

Responses​

OK

Response Headers
    Content-Type