DX STF Client API

<back to all web services

AddCustomerMaster

Customer Master Requests

Customer Master

Requires Authentication
The following routes are available for this service:
POST/api/customerMasterAdd new customer master
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class TokenDto implements ICommandResponse, JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $token=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['token'])) $this->token = $o['token'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->token)) $o['token'] = $this->token;
        return empty($o) ? new class(){} : $o;
    }
}

class AvpList implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $code='',
        /** @var string */
        public string $value=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['code'])) $this->code = $o['code'];
        if (isset($o['value'])) $this->value = $o['value'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->code)) $o['code'] = $this->code;
        if (isset($this->value)) $o['value'] = $this->value;
        return empty($o) ? new class(){} : $o;
    }
}

class Ecom_PartyIdentificationType implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $gln='',
        /** @var string */
        public string $name='',
        /** @var array<AvpList>|null */
        public ?array $additionalPartyIdentification=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['gln'])) $this->gln = $o['gln'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['additionalPartyIdentification'])) $this->additionalPartyIdentification = JsonConverters::fromArray('AvpList', $o['additionalPartyIdentification']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->gln)) $o['gln'] = $this->gln;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->additionalPartyIdentification)) $o['additionalPartyIdentification'] = JsonConverters::toArray('AvpList', $this->additionalPartyIdentification);
        return empty($o) ? new class(){} : $o;
    }
}

class CommunicationChannel implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $communicationChannelCode='',
        /** @var string */
        public string $communicationChannelName='',
        /** @var string */
        public string $communicationValue=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['communicationChannelCode'])) $this->communicationChannelCode = $o['communicationChannelCode'];
        if (isset($o['communicationChannelName'])) $this->communicationChannelName = $o['communicationChannelName'];
        if (isset($o['communicationValue'])) $this->communicationValue = $o['communicationValue'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->communicationChannelCode)) $o['communicationChannelCode'] = $this->communicationChannelCode;
        if (isset($this->communicationChannelName)) $o['communicationChannelName'] = $this->communicationChannelName;
        if (isset($this->communicationValue)) $o['communicationValue'] = $this->communicationValue;
        return empty($o) ? new class(){} : $o;
    }
}

class Contact implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $contactTypeCode='',
        /** @var string */
        public string $personName='',
        /** @var string */
        public string $departmentName='',
        /** @var string */
        public string $jobTitle='',
        /** @var string */
        public string $responsibility='',
        /** @var array<CommunicationChannel>|null */
        public ?array $communicationChannel=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['contactTypeCode'])) $this->contactTypeCode = $o['contactTypeCode'];
        if (isset($o['personName'])) $this->personName = $o['personName'];
        if (isset($o['departmentName'])) $this->departmentName = $o['departmentName'];
        if (isset($o['jobTitle'])) $this->jobTitle = $o['jobTitle'];
        if (isset($o['responsibility'])) $this->responsibility = $o['responsibility'];
        if (isset($o['communicationChannel'])) $this->communicationChannel = JsonConverters::fromArray('CommunicationChannel', $o['communicationChannel']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->contactTypeCode)) $o['contactTypeCode'] = $this->contactTypeCode;
        if (isset($this->personName)) $o['personName'] = $this->personName;
        if (isset($this->departmentName)) $o['departmentName'] = $this->departmentName;
        if (isset($this->jobTitle)) $o['jobTitle'] = $this->jobTitle;
        if (isset($this->responsibility)) $o['responsibility'] = $this->responsibility;
        if (isset($this->communicationChannel)) $o['communicationChannel'] = JsonConverters::toArray('CommunicationChannel', $this->communicationChannel);
        return empty($o) ? new class(){} : $o;
    }
}

class Address implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $streetAddressOne='',
        /** @var string */
        public string $streetAddressTwo='',
        /** @var string */
        public string $streetAddressThree='',
        /** @var string */
        public string $city='',
        /** @var string */
        public string $postalCode='',
        /** @var string */
        public string $provinceCode='',
        /** @var string */
        public string $countryCode=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['streetAddressOne'])) $this->streetAddressOne = $o['streetAddressOne'];
        if (isset($o['streetAddressTwo'])) $this->streetAddressTwo = $o['streetAddressTwo'];
        if (isset($o['streetAddressThree'])) $this->streetAddressThree = $o['streetAddressThree'];
        if (isset($o['city'])) $this->city = $o['city'];
        if (isset($o['postalCode'])) $this->postalCode = $o['postalCode'];
        if (isset($o['provinceCode'])) $this->provinceCode = $o['provinceCode'];
        if (isset($o['countryCode'])) $this->countryCode = $o['countryCode'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->streetAddressOne)) $o['streetAddressOne'] = $this->streetAddressOne;
        if (isset($this->streetAddressTwo)) $o['streetAddressTwo'] = $this->streetAddressTwo;
        if (isset($this->streetAddressThree)) $o['streetAddressThree'] = $this->streetAddressThree;
        if (isset($this->city)) $o['city'] = $this->city;
        if (isset($this->postalCode)) $o['postalCode'] = $this->postalCode;
        if (isset($this->provinceCode)) $o['provinceCode'] = $this->provinceCode;
        if (isset($this->countryCode)) $o['countryCode'] = $this->countryCode;
        return empty($o) ? new class(){} : $o;
    }
}

class FinancialRoutingNumber implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $number='',
        /** @var string */
        public string $numberTypeCode=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['number'])) $this->number = $o['number'];
        if (isset($o['numberTypeCode'])) $this->numberTypeCode = $o['numberTypeCode'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->number)) $o['number'] = $this->number;
        if (isset($this->numberTypeCode)) $o['numberTypeCode'] = $this->numberTypeCode;
        return empty($o) ? new class(){} : $o;
    }
}

class FinancialAccount implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $number='',
        /** @var string */
        public string $numberTypeCode='',
        /** @var string */
        public string $name=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['number'])) $this->number = $o['number'];
        if (isset($o['numberTypeCode'])) $this->numberTypeCode = $o['numberTypeCode'];
        if (isset($o['name'])) $this->name = $o['name'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->number)) $o['number'] = $this->number;
        if (isset($this->numberTypeCode)) $o['numberTypeCode'] = $this->numberTypeCode;
        if (isset($this->name)) $o['name'] = $this->name;
        return empty($o) ? new class(){} : $o;
    }
}

class FinancialInstitutionInformation implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $financialInstitutionBranchName='',
        /** @var string */
        public string $financialInstitutionName='',
        /** @var FinancialRoutingNumber|null */
        public ?FinancialRoutingNumber $financialRoutingNumber=null,
        /** @var FinancialAccount|null */
        public ?FinancialAccount $financialAccount=null,
        /** @var string */
        public string $swiftCode='',
        /** @var string */
        public string $exportersCode=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['financialInstitutionBranchName'])) $this->financialInstitutionBranchName = $o['financialInstitutionBranchName'];
        if (isset($o['financialInstitutionName'])) $this->financialInstitutionName = $o['financialInstitutionName'];
        if (isset($o['financialRoutingNumber'])) $this->financialRoutingNumber = JsonConverters::from('FinancialRoutingNumber', $o['financialRoutingNumber']);
        if (isset($o['financialAccount'])) $this->financialAccount = JsonConverters::from('FinancialAccount', $o['financialAccount']);
        if (isset($o['swiftCode'])) $this->swiftCode = $o['swiftCode'];
        if (isset($o['exportersCode'])) $this->exportersCode = $o['exportersCode'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->financialInstitutionBranchName)) $o['financialInstitutionBranchName'] = $this->financialInstitutionBranchName;
        if (isset($this->financialInstitutionName)) $o['financialInstitutionName'] = $this->financialInstitutionName;
        if (isset($this->financialRoutingNumber)) $o['financialRoutingNumber'] = JsonConverters::to('FinancialRoutingNumber', $this->financialRoutingNumber);
        if (isset($this->financialAccount)) $o['financialAccount'] = JsonConverters::to('FinancialAccount', $this->financialAccount);
        if (isset($this->swiftCode)) $o['swiftCode'] = $this->swiftCode;
        if (isset($this->exportersCode)) $o['exportersCode'] = $this->exportersCode;
        return empty($o) ? new class(){} : $o;
    }
}

class TransactionalParty extends Ecom_PartyIdentificationType implements JsonSerializable
{
    /**
     * @param string $gln
     * @param string $name
     * @param array<AvpList>|null $additionalPartyIdentification
     */
    public function __construct(
        string $gln='',
        string $name='',
        ?array $additionalPartyIdentification=null,
        /** @var array<Contact>|null */
        public ?array $contact=null,
        /** @var Address|null */
        public ?Address $address=null,
        /** @var array<AvpList>|null */
        public ?array $communicationChannel=null,
        /** @var FinancialInstitutionInformation|null */
        public ?FinancialInstitutionInformation $financialInstitutionInformation=null,
        /** @var string */
        public string $dutyFeeTaxRegistration='',
        /** @var string */
        public string $entityIdentification=''
    ) {
        parent::__construct($gln,$name,$additionalPartyIdentification);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['contact'])) $this->contact = JsonConverters::fromArray('Contact', $o['contact']);
        if (isset($o['address'])) $this->address = JsonConverters::from('Address', $o['address']);
        if (isset($o['communicationChannel'])) $this->communicationChannel = JsonConverters::fromArray('AvpList', $o['communicationChannel']);
        if (isset($o['financialInstitutionInformation'])) $this->financialInstitutionInformation = JsonConverters::from('FinancialInstitutionInformation', $o['financialInstitutionInformation']);
        if (isset($o['dutyFeeTaxRegistration'])) $this->dutyFeeTaxRegistration = $o['dutyFeeTaxRegistration'];
        if (isset($o['entityIdentification'])) $this->entityIdentification = $o['entityIdentification'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->contact)) $o['contact'] = JsonConverters::toArray('Contact', $this->contact);
        if (isset($this->address)) $o['address'] = JsonConverters::to('Address', $this->address);
        if (isset($this->communicationChannel)) $o['communicationChannel'] = JsonConverters::toArray('AvpList', $this->communicationChannel);
        if (isset($this->financialInstitutionInformation)) $o['financialInstitutionInformation'] = JsonConverters::to('FinancialInstitutionInformation', $this->financialInstitutionInformation);
        if (isset($this->dutyFeeTaxRegistration)) $o['dutyFeeTaxRegistration'] = $this->dutyFeeTaxRegistration;
        if (isset($this->entityIdentification)) $o['entityIdentification'] = $this->entityIdentification;
        return empty($o) ? new class(){} : $o;
    }
}

class CustomerMasterAddress extends Address implements JsonSerializable
{
    /**
     * @param string $streetAddressOne
     * @param string $streetAddressTwo
     * @param string $streetAddressThree
     * @param string $city
     * @param string $postalCode
     * @param string $provinceCode
     * @param string $countryCode
     */
    public function __construct(
        string $streetAddressOne='',
        string $streetAddressTwo='',
        string $streetAddressThree='',
        string $city='',
        string $postalCode='',
        string $provinceCode='',
        string $countryCode='',
        /** @var string */
        public string $addressType=''
    ) {
        parent::__construct($streetAddressOne,$streetAddressTwo,$streetAddressThree,$city,$postalCode,$provinceCode,$countryCode);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['addressType'])) $this->addressType = $o['addressType'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->addressType)) $o['addressType'] = $this->addressType;
        return empty($o) ? new class(){} : $o;
    }
}

class CustomerRecord implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $gln='',
        /** @var string */
        public string $code='',
        /** @var string */
        public string $name='',
        /** @var string */
        public string $buyerAssignedVendorNo='',
        /** @var string */
        public string $supplierAssignedVendorNo='',
        /** @var string */
        public string $dutyFeeTaxRegistration='',
        /** @var string */
        public string $entityIdentification='',
        /** @var array<Contact>|null */
        public ?array $contact=null,
        /** @var CustomerMasterAddress|null */
        public ?CustomerMasterAddress $address=null,
        /** @var array<AvpList>|null */
        public ?array $avpList=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['gln'])) $this->gln = $o['gln'];
        if (isset($o['code'])) $this->code = $o['code'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['buyerAssignedVendorNo'])) $this->buyerAssignedVendorNo = $o['buyerAssignedVendorNo'];
        if (isset($o['supplierAssignedVendorNo'])) $this->supplierAssignedVendorNo = $o['supplierAssignedVendorNo'];
        if (isset($o['dutyFeeTaxRegistration'])) $this->dutyFeeTaxRegistration = $o['dutyFeeTaxRegistration'];
        if (isset($o['entityIdentification'])) $this->entityIdentification = $o['entityIdentification'];
        if (isset($o['contact'])) $this->contact = JsonConverters::fromArray('Contact', $o['contact']);
        if (isset($o['address'])) $this->address = JsonConverters::from('CustomerMasterAddress', $o['address']);
        if (isset($o['avpList'])) $this->avpList = JsonConverters::fromArray('AvpList', $o['avpList']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->gln)) $o['gln'] = $this->gln;
        if (isset($this->code)) $o['code'] = $this->code;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->buyerAssignedVendorNo)) $o['buyerAssignedVendorNo'] = $this->buyerAssignedVendorNo;
        if (isset($this->supplierAssignedVendorNo)) $o['supplierAssignedVendorNo'] = $this->supplierAssignedVendorNo;
        if (isset($this->dutyFeeTaxRegistration)) $o['dutyFeeTaxRegistration'] = $this->dutyFeeTaxRegistration;
        if (isset($this->entityIdentification)) $o['entityIdentification'] = $this->entityIdentification;
        if (isset($this->contact)) $o['contact'] = JsonConverters::toArray('Contact', $this->contact);
        if (isset($this->address)) $o['address'] = JsonConverters::to('CustomerMasterAddress', $this->address);
        if (isset($this->avpList)) $o['avpList'] = JsonConverters::toArray('AvpList', $this->avpList);
        return empty($o) ? new class(){} : $o;
    }
}

class CreditLimit implements JsonSerializable
{
    public function __construct(
        /** @var float */
        public float $limit=0.0,
        /** @var float */
        public float $balance=0.0,
        /** @var float */
        public float $available=0.0,
        /** @var DateTime|null */
        public ?DateTime $effectiveDateTime=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['limit'])) $this->limit = $o['limit'];
        if (isset($o['balance'])) $this->balance = $o['balance'];
        if (isset($o['available'])) $this->available = $o['available'];
        if (isset($o['effectiveDateTime'])) $this->effectiveDateTime = JsonConverters::from('DateTime', $o['effectiveDateTime']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->limit)) $o['limit'] = $this->limit;
        if (isset($this->balance)) $o['balance'] = $this->balance;
        if (isset($this->available)) $o['available'] = $this->available;
        if (isset($this->effectiveDateTime)) $o['effectiveDateTime'] = JsonConverters::to('DateTime', $this->effectiveDateTime);
        return empty($o) ? new class(){} : $o;
    }
}

class CustomerMasterType extends CustomerRecord implements JsonSerializable
{
    /**
     * @param string $gln
     * @param string $code
     * @param string $name
     * @param string $buyerAssignedVendorNo
     * @param string $supplierAssignedVendorNo
     * @param string $dutyFeeTaxRegistration
     * @param string $entityIdentification
     * @param array<Contact>|null $contact
     * @param CustomerMasterAddress|null $address
     * @param array<AvpList>|null $avpList
     */
    public function __construct(
        string $gln='',
        string $code='',
        string $name='',
        string $buyerAssignedVendorNo='',
        string $supplierAssignedVendorNo='',
        string $dutyFeeTaxRegistration='',
        string $entityIdentification='',
        ?array $contact=null,
        ?CustomerMasterAddress $address=null,
        ?array $avpList=null,
        /** @var CustomerRecord|null */
        public ?CustomerRecord $payByCustomer=null,
        /** @var CustomerRecord|null */
        public ?CustomerRecord $billToCustomer=null,
        /** @var string */
        public string $routingCode='',
        /** @var string */
        public string $storeType='',
        /** @var string */
        public string $currencyCode='',
        /** @var string */
        public string $type='',
        /** @var string */
        public string $group='',
        /** @var string */
        public string $region='',
        /** @var string */
        public string $zoneRate='',
        /** @var string */
        public string $taxRule='',
        /** @var string */
        public string $paymentTerm='',
        /** @var string */
        public string $shipmentSite='',
        /** @var string */
        public string $shipmentSiteName='',
        /** @var string */
        public string $shipmentSiteGln='',
        /** @var string */
        public string $accountingCode='',
        /** @var string */
        public string $commercialRepresentative='',
        /** @var string */
        public string $commercialTerritory='',
        /** @var CreditLimit|null */
        public ?CreditLimit $credit=null,
        /** @var array<string>|null */
        public ?array $nod=null,
        /** @var array<string>|null */
        public ?array $ndd=null
    ) {
        parent::__construct($gln,$code,$name,$buyerAssignedVendorNo,$supplierAssignedVendorNo,$dutyFeeTaxRegistration,$entityIdentification,$contact,$address,$avpList);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['payByCustomer'])) $this->payByCustomer = JsonConverters::from('CustomerRecord', $o['payByCustomer']);
        if (isset($o['billToCustomer'])) $this->billToCustomer = JsonConverters::from('CustomerRecord', $o['billToCustomer']);
        if (isset($o['routingCode'])) $this->routingCode = $o['routingCode'];
        if (isset($o['storeType'])) $this->storeType = $o['storeType'];
        if (isset($o['currencyCode'])) $this->currencyCode = $o['currencyCode'];
        if (isset($o['type'])) $this->type = $o['type'];
        if (isset($o['group'])) $this->group = $o['group'];
        if (isset($o['region'])) $this->region = $o['region'];
        if (isset($o['zoneRate'])) $this->zoneRate = $o['zoneRate'];
        if (isset($o['taxRule'])) $this->taxRule = $o['taxRule'];
        if (isset($o['paymentTerm'])) $this->paymentTerm = $o['paymentTerm'];
        if (isset($o['shipmentSite'])) $this->shipmentSite = $o['shipmentSite'];
        if (isset($o['shipmentSiteName'])) $this->shipmentSiteName = $o['shipmentSiteName'];
        if (isset($o['shipmentSiteGln'])) $this->shipmentSiteGln = $o['shipmentSiteGln'];
        if (isset($o['accountingCode'])) $this->accountingCode = $o['accountingCode'];
        if (isset($o['commercialRepresentative'])) $this->commercialRepresentative = $o['commercialRepresentative'];
        if (isset($o['commercialTerritory'])) $this->commercialTerritory = $o['commercialTerritory'];
        if (isset($o['credit'])) $this->credit = JsonConverters::from('CreditLimit', $o['credit']);
        if (isset($o['nod'])) $this->nod = JsonConverters::fromArray('string', $o['nod']);
        if (isset($o['ndd'])) $this->ndd = JsonConverters::fromArray('string', $o['ndd']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->payByCustomer)) $o['payByCustomer'] = JsonConverters::to('CustomerRecord', $this->payByCustomer);
        if (isset($this->billToCustomer)) $o['billToCustomer'] = JsonConverters::to('CustomerRecord', $this->billToCustomer);
        if (isset($this->routingCode)) $o['routingCode'] = $this->routingCode;
        if (isset($this->storeType)) $o['storeType'] = $this->storeType;
        if (isset($this->currencyCode)) $o['currencyCode'] = $this->currencyCode;
        if (isset($this->type)) $o['type'] = $this->type;
        if (isset($this->group)) $o['group'] = $this->group;
        if (isset($this->region)) $o['region'] = $this->region;
        if (isset($this->zoneRate)) $o['zoneRate'] = $this->zoneRate;
        if (isset($this->taxRule)) $o['taxRule'] = $this->taxRule;
        if (isset($this->paymentTerm)) $o['paymentTerm'] = $this->paymentTerm;
        if (isset($this->shipmentSite)) $o['shipmentSite'] = $this->shipmentSite;
        if (isset($this->shipmentSiteName)) $o['shipmentSiteName'] = $this->shipmentSiteName;
        if (isset($this->shipmentSiteGln)) $o['shipmentSiteGln'] = $this->shipmentSiteGln;
        if (isset($this->accountingCode)) $o['accountingCode'] = $this->accountingCode;
        if (isset($this->commercialRepresentative)) $o['commercialRepresentative'] = $this->commercialRepresentative;
        if (isset($this->commercialTerritory)) $o['commercialTerritory'] = $this->commercialTerritory;
        if (isset($this->credit)) $o['credit'] = JsonConverters::to('CreditLimit', $this->credit);
        if (isset($this->nod)) $o['nod'] = JsonConverters::toArray('string', $this->nod);
        if (isset($this->ndd)) $o['ndd'] = JsonConverters::toArray('string', $this->ndd);
        return empty($o) ? new class(){} : $o;
    }
}

class CustomerMasterMessage implements JsonSerializable
{
    public function __construct(
        /** @var TransactionalParty|null */
        public ?TransactionalParty $dataSource=null,
        /** @var TransactionalParty|null */
        public ?TransactionalParty $dataRecipient=null,
        /** @var string */
        public string $customerMasterIdentification='',
        /** @var array<CustomerMasterType>|null */
        public ?array $customer=null,
        /** @var string */
        public string $documentStatusCode='',
        /** @var string */
        public string $documentActionCode='',
        /** @var DateTime */
        public DateTime $creationDateTime=new DateTime(),
        /** @var DateTime */
        public DateTime $lastUpdateDateTime=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['dataSource'])) $this->dataSource = JsonConverters::from('TransactionalParty', $o['dataSource']);
        if (isset($o['dataRecipient'])) $this->dataRecipient = JsonConverters::from('TransactionalParty', $o['dataRecipient']);
        if (isset($o['customerMasterIdentification'])) $this->customerMasterIdentification = $o['customerMasterIdentification'];
        if (isset($o['customer'])) $this->customer = JsonConverters::fromArray('CustomerMasterType', $o['customer']);
        if (isset($o['documentStatusCode'])) $this->documentStatusCode = $o['documentStatusCode'];
        if (isset($o['documentActionCode'])) $this->documentActionCode = $o['documentActionCode'];
        if (isset($o['creationDateTime'])) $this->creationDateTime = JsonConverters::from('DateTime', $o['creationDateTime']);
        if (isset($o['lastUpdateDateTime'])) $this->lastUpdateDateTime = JsonConverters::from('DateTime', $o['lastUpdateDateTime']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->dataSource)) $o['dataSource'] = JsonConverters::to('TransactionalParty', $this->dataSource);
        if (isset($this->dataRecipient)) $o['dataRecipient'] = JsonConverters::to('TransactionalParty', $this->dataRecipient);
        if (isset($this->customerMasterIdentification)) $o['customerMasterIdentification'] = $this->customerMasterIdentification;
        if (isset($this->customer)) $o['customer'] = JsonConverters::toArray('CustomerMasterType', $this->customer);
        if (isset($this->documentStatusCode)) $o['documentStatusCode'] = $this->documentStatusCode;
        if (isset($this->documentActionCode)) $o['documentActionCode'] = $this->documentActionCode;
        if (isset($this->creationDateTime)) $o['creationDateTime'] = JsonConverters::to('DateTime', $this->creationDateTime);
        if (isset($this->lastUpdateDateTime)) $o['lastUpdateDateTime'] = JsonConverters::to('DateTime', $this->lastUpdateDateTime);
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Customer Master */
// @Api(Description="Customer Master")
// @ApiResponse(Description="Add customer master request received", IsDefaultResponse=true, StatusCode=200)
// @ApiResponse(Description="Customer master request not accepted, Confirm Sender GLN", ResponseType="typeof(System.UnauthorizedAccessException)", StatusCode=403)
class AddCustomerMaster implements JsonSerializable
{
    public function __construct(
        /** @description Customer Master model containing all of the Customer Master data */
        // @ApiMember(Description="Customer Master model containing all of the Customer Master data", ParameterType="model")
        /** @var CustomerMasterMessage|null */
        public ?CustomerMasterMessage $customerMaster=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['customerMaster'])) $this->customerMaster = JsonConverters::from('CustomerMasterMessage', $o['customerMaster']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->customerMaster)) $o['customerMaster'] = JsonConverters::to('CustomerMasterMessage', $this->customerMaster);
        return empty($o) ? new class(){} : $o;
    }
}

PHP AddCustomerMaster DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/customerMaster HTTP/1.1 
Host: stf-api-uat.data-xchange.co.za 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"customerMaster":{"dataSource":{"contact":[{"contactTypeCode":"String","personName":"String","departmentName":"String","jobTitle":"String","responsibility":"String","communicationChannel":[{"communicationChannelCode":"String","communicationChannelName":"String","communicationValue":"String"}]}],"address":{"streetAddressOne":"String","streetAddressTwo":"String","streetAddressThree":"String","city":"String","postalCode":"String","provinceCode":"String","countryCode":"String"},"communicationChannel":[{"code":"String","value":"String"}],"financialInstitutionInformation":{"financialInstitutionBranchName":"String","financialInstitutionName":"String","financialRoutingNumber":{"number":"String","numberTypeCode":"String"},"financialAccount":{"number":"String","numberTypeCode":"String","name":"String"},"swiftCode":"String","exportersCode":"String"},"dutyFeeTaxRegistration":"String","entityIdentification":"String","gln":"String","name":"String","additionalPartyIdentification":[{"code":"String","value":"String"}]},"dataRecipient":{"contact":[{"contactTypeCode":"String","personName":"String","departmentName":"String","jobTitle":"String","responsibility":"String","communicationChannel":[{"communicationChannelCode":"String","communicationChannelName":"String","communicationValue":"String"}]}],"address":{"streetAddressOne":"String","streetAddressTwo":"String","streetAddressThree":"String","city":"String","postalCode":"String","provinceCode":"String","countryCode":"String"},"communicationChannel":[{"code":"String","value":"String"}],"financialInstitutionInformation":{"financialInstitutionBranchName":"String","financialInstitutionName":"String","financialRoutingNumber":{"number":"String","numberTypeCode":"String"},"financialAccount":{"number":"String","numberTypeCode":"String","name":"String"},"swiftCode":"String","exportersCode":"String"},"dutyFeeTaxRegistration":"String","entityIdentification":"String","gln":"String","name":"String","additionalPartyIdentification":[{"code":"String","value":"String"}]},"customerMasterIdentification":"String","customer":[{"payByCustomer":{"gln":"String","code":"String","name":"String","buyerAssignedVendorNo":"String","supplierAssignedVendorNo":"String","dutyFeeTaxRegistration":"String","entityIdentification":"String","contact":[{"contactTypeCode":"String","personName":"String","departmentName":"String","jobTitle":"String","responsibility":"String","communicationChannel":[{"communicationChannelCode":"String","communicationChannelName":"String","communicationValue":"String"}]}],"address":{"addressType":"String","streetAddressOne":"String","streetAddressTwo":"String","streetAddressThree":"String","city":"String","postalCode":"String","provinceCode":"String","countryCode":"String"},"avpList":[{"code":"String","value":"String"}]},"billToCustomer":{"gln":"String","code":"String","name":"String","buyerAssignedVendorNo":"String","supplierAssignedVendorNo":"String","dutyFeeTaxRegistration":"String","entityIdentification":"String","contact":[{"contactTypeCode":"String","personName":"String","departmentName":"String","jobTitle":"String","responsibility":"String","communicationChannel":[{"communicationChannelCode":"String","communicationChannelName":"String","communicationValue":"String"}]}],"address":{"addressType":"String","streetAddressOne":"String","streetAddressTwo":"String","streetAddressThree":"String","city":"String","postalCode":"String","provinceCode":"String","countryCode":"String"},"avpList":[{"code":"String","value":"String"}]},"routingCode":"String","storeType":"String","currencyCode":"String","type":"String","group":"String","region":"String","zoneRate":"String","taxRule":"String","paymentTerm":"String","shipmentSite":"String","shipmentSiteName":"String","shipmentSiteGln":"String","accountingCode":"String","commercialRepresentative":"String","commercialTerritory":"String","credit":{"limit":0,"balance":0,"available":0,"effectiveDateTime":"0001-01-01"},"nod":["String"],"ndd":["String"],"gln":"String","code":"String","name":"String","buyerAssignedVendorNo":"String","supplierAssignedVendorNo":"String","dutyFeeTaxRegistration":"String","entityIdentification":"String","contact":[{"contactTypeCode":"String","personName":"String","departmentName":"String","jobTitle":"String","responsibility":"String","communicationChannel":[{"communicationChannelCode":"String","communicationChannelName":"String","communicationValue":"String"}]}],"address":{"addressType":"String","streetAddressOne":"String","streetAddressTwo":"String","streetAddressThree":"String","city":"String","postalCode":"String","provinceCode":"String","countryCode":"String"},"avpList":[{"code":"String","value":"String"}]}],"documentStatusCode":"String","documentActionCode":"String"}}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{}