---
title: "assignEndCustomer user"
method: POST
path: "/users/assign-end-customer"
tags: ["user"]
---

# assignEndCustomer user

`POST /users/assign-end-customer`

Search for an existing End Customer or create a new one, then assign it to the user.

## Request body

- EndCustomerMatcherPayload — User data for matching End Customer
  - `company_name` string, required — The End Customer company name
  - `country_code` string, required — The End Customer country code
  - `offer_id` string, required — The Offer Id
  - `type` 'Sole proprietorship' | 'Partnership' | 'Corporation' | 'Limited Liability Company (LLC)' — Type of the company (required for US)
  - `vat_number` string — The End Customer vat number

## Response `200`

OK response.

- EndCustomerWithUser
  - `end_customer` EndCustomer, required
    - `billing_address` Address, required
      - `city` string, required — City
      - `country_code` string, required — ISO 3166-1 alpha-2
      - `line1` string, required — First line (street, number, etc.)
      - `line2` string — Second line (flat number, etc.)
      - `postal_code` string, required — Postal code
      - `region` string — Region, county, province, etc.
    - `company_registration_number` string — end-customer Company Registration Number
    - `email_domain` string, required — end-customer email domain
    - `group` string — end-customer group
    - `id` string, regexp, required — end-customer ID
    - `in_migration` boolean, required — is the end-customer currently being migrated
    - `is_new` boolean, required — end-customer is new
    - `language` string, required — end-customer language
    - `name` string, required — end-customer name
    - `not_vat_registered` boolean — end-customer declared it has no VAT number
    - `risk_status` string — end-customer risk status
    - `tax_number` string — end-customer tax number
    - `type` 'Sole proprietorship' | 'Partnership' | 'Corporation' | 'Limited Liability Company (LLC)' — Type of the company (required for US)
    - `vat_number` string — end-customer VAT number
  - `end_user` EndUser, required
    - `email` string — end-user email
    - `first_name` string — end-user first name
    - `id` string, regexp, required — end-user ID
    - `is_new` boolean, required — end-user is new
    - `last_name` string — end-user last name
    - `phone_number` PhoneNumber
      - `country_code` string, required — Country code
      - `country_prefix` string, required — Country code prefix
      - `international_format` string, required — International phone number format
      - `national` string, required — National phone number
      - `number` string, required — E164 number
    - `phone_type` string — end-user phone type

## Other responses

- `401` — Unauthorized: Unauthorized response.
- `403` — InvalidScopes: Forbidden response.
- `404` — NotFound: cannot find user
- `422` — ValidationError: Validation errors

---

[API](https://skmtc.net/topi/apis/topi-public-api.md) · [All operations](https://skmtc.net/topi/apis/topi-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/topi/topi-public-api/versions/fa134b7fc959/schema)
