Type Alias: CreateMerchantDtoPayload
@arolariu/website / types/invoices/Merchant / CreateMerchantDtoPayload
Type Alias: CreateMerchantDtoPayload
CreateMerchantDtoPayload =
object
Defined in: types/invoices/Merchant.ts:185
DTO payload for creating a new merchant entry.
Remarks
Required Fields:
name: Unique merchant identifier for UI displaydescription: Additional context for the merchantaddress: Physical location for geo-based featuresparentCompanyId: Links to parent (use empty string for root merchants)
Deduplication: Before creating, the API checks for existing merchants with similar names and addresses to prevent duplicates. If a match is found, the existing merchant ID is returned instead.
Example
const payload: CreateMerchantDtoPayload = {
name: "Carrefour Orhideea",
description: "Carrefour hypermarket in AFI Cotroceni mall",
address: "Bd. Vasile Milea 4, Bucharest",
parentCompanyId: "carrefour-romania-uuid"
};
const response = await fetch("/api/merchants", {
method: "POST",
body: JSON.stringify(payload)
});
See
Merchant for the created entity structure
Properties
name
readonlyname:string
Defined in: types/invoices/Merchant.ts:187
The name of the merchant.
description
readonlydescription:string
Defined in: types/invoices/Merchant.ts:190
The description of the merchant.
address
readonlyaddress:string
Defined in: types/invoices/Merchant.ts:193
The address of the merchant.
parentCompanyId
readonlyparentCompanyId:string
Defined in: types/invoices/Merchant.ts:196
The unique identifier of the parent company.