Unidy Docs

Registration during checkout

Create a Unidy account after checkout and link existing customers safely.

Register a customer during checkout

Let customers complete a purchase and choose whether to create a Unidy account using the details they already entered. Unidy also supports confirmation-less registration where enabled; this backend invitation recipe is a separate path and does not automatically authenticate a newly created customer.

Reuse an existing session

On arrival, try silent authorization to reuse a Unidy session and prefill the shop profile. Handle a result requiring interaction by continuing the guest checkout or offering normal sign-in. Silent authorization cannot guarantee a browser session is available.

Ask before creating an account

Offer a clear account-creation choice in the checkout form, alongside the customer name, email and address fields. Keep the choice separate from newsletter consent. Have the checkout owner select the wording and checkbox default appropriate to the rollout; the old example's suggestion to preselect it is not a universal consent rule.

Find an existing account

After the customer chooses account creation, use your backend's client-credentials token to call GET /api/v1/users/by_email?email=… with users:read_by_email. Never expose that token in the checkout browser. Follow the complete find-or-create recipe, including validation, 404 handling and reconciliation after a concurrent create or lost response.

For an existing account, offer sign-in with the email prefilled:

text
https://YOUR_BRAND_HOST/logins?login_hint=customer%40example.com

URL-encode login_hint and retain the intended checkout return destination through your authentication flow. Knowing an email or finding its account is not authentication and must not attach someone else's private profile to a guest session.

Create after checkout

Once checkout is complete and the customer has chosen account creation, call POST /api/v1/users from your backend with users:write. Configure the brand, email language and invitation return destination before sending real invitations.

json
{
  "accept_invitation_return_url": "https://shop.example.com/account",
  "send_invitation": true,
  "email": "customer@example.com",
  "brand": "YOUR_BRAND_NAME",
  "first_name": "Alex",
  "last_name": "Example",
  "salutation": "mr",
  "phone_number": "+49123456789",
  "date_of_birth": "1991-06-10",
  "company_name": "Example Ltd",
  "address_line_1": "Example Street 70a",
  "address_line_2": "Floor 5",
  "city": "London",
  "postal_code": "SW1A 1AA",
  "country_code": "GB",
  "preferred_language": "en",
  "custom_attributes": {
    "YOUR_DEFINED_ATTRIBUTE": "value"
  }
}
FieldSetup and effect
send_invitationtrue sends an email inviting the customer to claim the account; it is not a newsletter DOI email.
accept_invitation_return_urlDestination after invitation acceptance. Allow its host in the brand's redirect configuration before creation.
brandBrand name for a multibrand instance, including email branding. If omitted, the request host/current brand determines the context.
Profile/address fieldsSend only collected, supported values; country_code is an ISO alpha-2 code and date_of_birth is a date.
preferred_languageCustomer language. The API also supports ui_locales; see the live schema for available language selection.
custom_attributesUse existing API-accessible definitions and their configured value types and validation rules.

A successful create returns 201 and the user object. Store its public id for later order association. Read back uncertain outcomes before retrying, so a completed checkout does not send duplicate invitations. Test existing users, new users, declined account creation and invitation return links before launch.

Was this page helpful?