Skip to main content

Type Alias: CreateMerchantDtoPayload

@arolariu/website


@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 display
  • description: Additional context for the merchant
  • address: Physical location for geo-based features
  • parentCompanyId: 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

readonly name: string

Defined in: types/invoices/Merchant.ts:187

The name of the merchant.


description

readonly description: string

Defined in: types/invoices/Merchant.ts:190

The description of the merchant.


address

readonly address: string

Defined in: types/invoices/Merchant.ts:193

The address of the merchant.


parentCompanyId

readonly parentCompanyId: string

Defined in: types/invoices/Merchant.ts:196

The unique identifier of the parent company.

// was this page useful?