---
title: "Assign customer"
method: POST
path: "/purchases/actions/assign-customer"
tags: ["Purchases"]
---

# Assign customer

`POST /purchases/actions/assign-customer`

The method assigns customer to the existing purchase. If customer could collect points, he is going to gain corresponding amount of points.
⚠️ Endpoint is available only in the Enterprise interface.

## Headers

- `Accept-Language` string

## Request body

- object
  - `store_id` string, required — ID of the store.
  - `external_purchase_id` string, required — A unique identifier for an existing purchase in the production system (e.g., E-commerce, POS, ERP). This ID must be unique within the system and reference an actual purchase or order. If the purchase was created in CareCloud using the CareCloud API, use the same value as the bill_id parameter from the [POST /send-purchase](https://carecloud.readme.io/reference/postpurchasesend) endpoint.
  - `card_number` string — Number of the customer card. Parameter is mandatory only if customer_id is not set.
  - `customer_id` string — The unique ID of the customer. Parameter is mandatory only if card_number is not set.

## Response `204`

No Content

## Other responses

- `400` — Bad input parameter. The response body's `error.error_data.invalid_params[]` array lists the parameters that caused the failure, each carrying a `reason` code. See the `BadRequestErrorBody` schema for the generic reason taxonomy. Operations with domain-specific business rules document additional reasons at the operation level.
- `401` — The client has invalid credentials or auth token.
- `403` — The client does not exist or the client tried to access an unauthorized property or resource.
- `404` — The resource was not found.
- `405` — The resource does not support the specified HTTP method.
- `429` — Too many requests - more than the resource limit.
- `500` — Server is not working as expected.
- `503` — Temporary state when the service is temporarily unavailable, overloaded or there is a maintenance window.

---

[API](https://skmtc.net/crmcarecloud/apis/rest-api-reference.md) · [All operations](https://skmtc.net/crmcarecloud/apis/rest-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/crmcarecloud/rest-api-reference/revisions/329c06dbf8d9/schema)
