---
title: "Attach, change or detach an order's customer"
method: POST
path: "/api/public/v1/orders/setCustomer"
tags: ["orders"]
---

# Attach, change or detach an order's customer

`POST /api/public/v1/orders/setCustomer`

## Request

- Base URL: `https://app.fortuneos.ai`
- URL: `https://app.fortuneos.ai/api/public/v1/orders/setCustomer`
- Auth: none declared

Sets the order's customer, or clears it with a null customerId. A paid order earns its loyalty points for a member attached to it while the business takes new Loyalty work (its own switch is on, and its plan neither restricts nor lacks Loyalty). Once any loyalty ledger or stamp entry names the order (points earned, spent or reversed on it, or stamps earned or taken back), a change or detach is refused with BAD_REQUEST and refusal customerLockedByLoyalty. Once the order's payment sold or renewed a pass, a change or detach is refused with BAD_REQUEST and refusal customerLockedByPass. On an order holding or redeeming a pass, a change or detach of the customer while a card terminal charge for it is live or a guest is paying it from the QR menu is refused with CONFLICT as `passChargeLive`: the charge was admitted for the customer it verified, and its settlement sells or redeems the pass for the customer on the order. A change of customer moves the order's pass discount to the line a pass the new customer holds covers, and lets a new customer redeem after the last was charged full price. orders.get answers canChangeCustomer beforehand. On an own-rider delivery order, attaching fills the recipient's blank name and phone from the customer and a blank address (Address, Area and City all empty) with the customer's default saved address; a recipient or address still holding the replaced customer's phone or default address is replaced. A paid order's address is never written, and detaching leaves the recipient and address as they are. Refused with `shiftClosed` once the order's shift has closed (FORBIDDEN; BAD_REQUEST when creating under it) and with FORBIDDEN `notShiftParticipant` for a caller not taking part in the shift. Refused with FORBIDDEN as `paywallLocked` when the caller is an Owner or Manager of a business the merchant Paywall locks: one with no verified subscription that has taken 5 orders while the Paywall's rollout reaches it, an order counting from its first saved line, whether or not it is paid or completed, until it is archived or cancelled before activation. Nothing is read or written; a verified subscription lifts the lock.

## Request body

- object
  - `orderId` string, required
  - `customerId` string, nullable, required

## Response `200`

OK

- unknown

---

[API](https://skmtc.dev/fortis/apis/fortune-os-api.md) - [All operations](https://skmtc.dev/fortis/apis/fortune-os-api/llms.txt) - [OpenAPI document](https://skmtc.dev/fortis/apis/fortune-os-api/revisions/522f3cea550d?raw)
