Customer aliases
A customer alias is another of your IDs for a customer, or for one of its units. Once an alias exists, its value works anywhere the API accepts a customer: on events, orders and in paths. Aliases are for systems that have no way to store Paid’s cus_ ID, such as a product platform that only knows its own workspace IDs. With an alias, usage from every system lands on one customer, one balance and one invoice, instead of a stray draft customer that’s never billed.
Use a customer alias to:
- Accept usage from another system that sends events under its own ID, without changing what it sends.
- Route a tenant to a unit, such as a QA workspace to a non-billable customer unit.
- Recover usage that arrived under an ID before any customer had it: creating the alias releases the usage Paid held for it.
- Name a person by email, so their usage and their seat find the right unit.
Customer aliases are in the customer_aliases=v1 beta: send Paid-Beta: customer_aliases=v1 with each request.
How aliases resolve
Wherever a request names a customer, Paid looks the value up in this order:
- A Paid ID, if the value starts
cus_. - A customer’s
externalId. - An alias, archived or not.
An alias value is unique across your account, ignoring letter case, among every alias, every customer’s externalId and every unit’s externalId. So a value always names exactly one customer, whichever system sends it.
Prefer Paid’s IDs wherever you can store them. An alias is the fallback for a system that can’t.
Create an alias
Litware creates its customers from its CRM, so Northwind Traders is cus_8HqL2xT, with the CRM’s ID northwind as its externalId. Litware’s ticketing platform sends usage under its own workspace ID for Northwind, ws_northwind_prod, and has nowhere to store Paid’s. Litware adds the workspace ID as an alias:
API
Dashboard
Create a customer alias on the customer, naming the system that uses it in source:
A value a draft customer already holds as its externalId is refused with alias_held_by_draft_customer. Usage sent under the value before the alias existed and held by Paid is released to the customer when you create the alias.
The ticketing platform keeps sending its own ID, and the usage lands on Northwind:
The stored event’s customer is cus_8HqL2xT.
Point an alias at a unit
Set customerUnit to send everything under an alias to one unit. Northwind also has a QA workspace on the ticketing platform, which Litware models as a non-billable unit qa:
Events sent as customer: "ws_northwind_qa" now land on Northwind’s QA unit: recorded, never billed. Because aliases are unique across your account, this is also how a system that only knows a unit names it on its own, without the customer.
Change or retire an alias
Update an alias to change its source or metadata at any time. value, customer and customerUnit never change.
usedsays whether usage has been recorded under an alias’s value, andfirstUsedAtwhen usage was first recorded under this value. Naming the customer by the alias in an API call doesn’t count.firstUsedAtcan be earlier than the alias’screatedAt: usage sent under the value before the alias existed counts, such as a signal held and then released, or an earlier alias of the same value.usedis usually a few minutes behind. Usage recorded late (repaired, or released from hold after the alias was created) can take up to a day, and usage recorded more than three days after it happened is counted only when Paid next runs a full catch-up.- An alias no usage was ever sent under can be deleted, which frees its value. Paid checks the usage it recorded when you delete, without waiting for
used. - An alias that has been used can’t be deleted. When you stop sending under it, archive it: it leaves the default list, but it keeps working, so usage sent late or backfilled under it still lands on the customer. Unarchive puts it back in the list.
When a customer’s externalId changes, Paid keeps the old ID as an alias so usage sent under it still lands. Aliases Paid makes have systemManaged: true and can’t be updated, archived or deleted.