GetCustomerResponse
Properties
-
data(['object', 'null'])Customer detail data. Cannot contain additional properties.defaultWarehouseId(['string', 'null'])Default warehouse identifier.id(['string', 'null'])Customer identifier.xmlSenderId(['string', 'null'])XML sender identifier.-
billingEntities(['array', 'null'])Billing entities.-
Items (object)Cannot contain additional properties.
id(string, required)Billing entity identifier.xmlSenderId(['string', 'null'])XmlSenderId override.-
addresses(['array', 'null'])Addresses linked to this billing entity.-
Items (object)Cannot contain additional properties.
xmlSenderId(['string', 'null'])XmlSenderId.address1(string, required)Address line 1.address2(['string', 'null'])Address line 2.address3(['string', 'null'])Address line 3.city(string, required)City.code(string, required)Address code.company(['string', 'null'])Company name.country(string, required)Country.emailAddress(['string', 'null'])Email address.faxNumber(['string', 'null'])Fax number.isBillToDefault(boolean, required)Bill-to default flag.isShipToDefault(boolean, required)Ship-to default flag.name(string, required)Address name.phoneNumber(['string', 'null'])Phone number.postalCode(string, required)Postal code.stateProvince(string, required)State or province.
-
-
isDefaultForCustomer(boolean)Indicates whether this is the default billing entity for the customer.
-
-
brokerScopes(['array', 'null'])Broker scopes.- Items (string)
-
contactAddress(['object', 'null'])Contact address. Cannot contain additional properties.address1(['string', 'null'])Address line 1.address2(['string', 'null'])Address line 2.address3(['string', 'null'])Address line 3.city(['string', 'null'])City.company(['string', 'null'])Company name.country(['string', 'null'])Country.faxNumber(['string', 'null'])Fax number.name(['string', 'null'])Contact name.phoneNumber(['string', 'null'])Phone number.postalCode(['string', 'null'])Postal code.stateProvince(['string', 'null'])State or province.
-
contactEmailAddress(['string', 'null'])Contact email address. directMailProvider(['string', 'null'])Direct mail provider.doValidateOrderPrice(['boolean', 'null'])Order price validation flag.-
emailNotificationSubscriptions(['array', 'null'])Email notification subscriptions.-
Items (object)Cannot contain additional properties.
emailNotificationTemplateId(['string', 'null'])Email notification template identifier.-
emailAddresses(['array', 'null'])Array of email addresses.- Items (string)
-
-
emailServiceProvider(['string', 'null'])Email service provider. inheritParentOffers(['boolean', 'null'])Inherit parent offers flag.invoiceEmailAddress(['string', 'null'])Invoice email address.mailingFileLocation(['string', 'null'])Mailing file location.name(['string', 'null'])Customer name.offerRevisionDelimiter(['string', 'null'])Offer revision delimiter.-
parent(['object', 'null'])Parent customer reference. Cannot contain additional properties.id(['string', 'null'])Parent customer identifier.name(['string', 'null'])Parent customer name.
-
paymentEmailAddress(['string', 'null'])Payment email address. productionFileLocation(['string', 'null'])Production file location.-
shipMethodMappings(['array', 'null'])Ship method mappings.-
Items (object)Cannot contain additional properties.
ratesProviderShipMethodId(['string', 'null'])Rates provider ship method identifier.sourceSystemShipMethodId(['string', 'null'])Source system ship method identifier.-
fulfillmentSystemShipMethods(['array', 'null'])Fulfillment system ship methods.-
Items (object)Cannot contain additional properties.
fulfillmentSystemId(['integer', 'null'])Fulfillment system identifier.fulfillmentSystemShipMethodId(['string', 'null'])Fulfillment system ship method identifier.fulfillmentSystemName(['string', 'null'])Fulfillment system name.
-
-
trackingUrl(['string', 'null'])Tracking URL.
-
-
sourceSystems(['array', 'null'])Source systems.-
Items (object)Cannot contain additional properties.
authClientId(['string', 'null'])Auth0 client identifier.id(['integer', 'null'])Source system identifier.sourceSystemCustomerId(['string', 'null'])This is an automatically generated field added by middleware. It is considered read-only.clientSecret(['string', 'null'])Auth0 client secret.name(['string', 'null'])Source system name.
-
-
useDefaultBillingEntity(['boolean', 'null'])Use default billing entity flag.
-
failureMessages(array)- Items (string)
-
informationalMessages(array)- Items (string)
-
operationWasSuccessful(boolean)
Quicktype Command
quicktype \
--framework SystemTextJson \
--lang cs \
--number-type double \
--src-lang schema \
--no-check-required \
--density dense \
--features complete \
--namespace OtpSchema.Api.CustomerBroker.GetCustomerResponse \
--src .working/build/internal/json-schema-for-cs/GetCustomerResponse.json -o .working/build/internal/csharp/OtpSchema/Api/CustomerBroker/GetCustomerResponse.cs
// <auto-generated />
//
// To parse this JSON data, add NuGet 'System.Text.Json' then do:
//
// using OtpSchema.Api.CustomerBroker.GetCustomerResponse;
//
// var getCustomerResponse = GetCustomerResponse.FromJson(jsonString);
#nullable enable
#pragma warning disable CS8618
#pragma warning disable CS8601
#pragma warning disable CS8603
namespace OtpSchema.Api.CustomerBroker.GetCustomerResponse
{
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Globalization;
using J = System.Text.Json.Serialization.JsonPropertyNameAttribute;
using N = System.Text.Json.Serialization.JsonIgnoreCondition;
public partial class GetCustomerResponse
{
[J("data")] public Data Data { get; set; } // Customer detail data.
[J("failureMessages")] public string[]? FailureMessages { get; set; }
[J("informationalMessages")] public string[]? InformationalMessages { get; set; }
[J("operationWasSuccessful")] public bool OperationWasSuccessful { get; set; }
}
public partial class Data
{
[J("billingEntities")] public BillingEntity[]? BillingEntities { get; set; } // Billing entities.
[J("brokerScopes")] public string[]? BrokerScopes { get; set; } // Broker scopes.
[J("contactAddress")] public ContactAddress ContactAddress { get; set; } // Contact address.
[J("contactEmailAddress")] public string ContactEmailAddress { get; set; } // Contact email address.
[J("defaultWarehouseId")] public string DefaultWarehouseId { get; set; } // Default warehouse identifier.
[J("directMailProvider")] public string DirectMailProvider { get; set; } // Direct mail provider.
[J("doValidateOrderPrice")] public bool? DoValidateOrderPrice { get; set; } // Order price validation flag.
[J("emailNotificationSubscriptions")] public EmailNotificationSubscription[]? EmailNotificationSubscriptions { get; set; } // Email notification subscriptions.
[J("emailServiceProvider")] public string EmailServiceProvider { get; set; } // Email service provider.
[J("id")] public string Id { get; set; } // Customer identifier.
[J("inheritParentOffers")] public bool? InheritParentOffers { get; set; } // Inherit parent offers flag.
[J("invoiceEmailAddress")] public string InvoiceEmailAddress { get; set; } // Invoice email address.
[J("mailingFileLocation")] public string MailingFileLocation { get; set; } // Mailing file location.
[J("name")] public string Name { get; set; } // Customer name.
[J("offerRevisionDelimiter")] public string OfferRevisionDelimiter { get; set; } // Offer revision delimiter.
[J("parent")] public Parent Parent { get; set; } // Parent customer reference.
[J("paymentEmailAddress")] public string PaymentEmailAddress { get; set; } // Payment email address.
[J("productionFileLocation")] public string ProductionFileLocation { get; set; } // Production file location.
[J("shipMethodMappings")] public ShipMethodMapping[]? ShipMethodMappings { get; set; } // Ship method mappings.
[J("sourceSystems")] public SourceSystem[]? SourceSystems { get; set; } // Source systems.
[J("useDefaultBillingEntity")] public bool? UseDefaultBillingEntity { get; set; } // Use default billing entity flag.
[J("xmlSenderId")] public string XmlSenderId { get; set; } // XML sender identifier.
}
public partial class BillingEntity
{
[J("addresses")] public Address[]? Addresses { get; set; } // Addresses linked to this billing entity.
[J("id")] public string Id { get; set; } // Billing entity identifier.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)][J("isDefaultForCustomer")] public bool? IsDefaultForCustomer { get; set; } // Indicates whether this is the default billing entity for the customer.
[J("xmlSenderId")] public string XmlSenderId { get; set; } // XmlSenderId override.
}
public partial class Address
{
[J("address1")] public string Address1 { get; set; } // Address line 1.
[J("address2")] public string Address2 { get; set; } // Address line 2.
[J("address3")] public string Address3 { get; set; } // Address line 3.
[J("city")] public string City { get; set; } // City.
[J("code")] public string Code { get; set; } // Address code.
[J("company")] public string Company { get; set; } // Company name.
[J("country")] public string Country { get; set; } // Country.
[J("emailAddress")] public string EmailAddress { get; set; } // Email address.
[J("faxNumber")] public string FaxNumber { get; set; } // Fax number.
[J("isBillToDefault")] public bool IsBillToDefault { get; set; } // Bill-to default flag.
[J("isShipToDefault")] public bool IsShipToDefault { get; set; } // Ship-to default flag.
[J("name")] public string Name { get; set; } // Address name.
[J("phoneNumber")] public string PhoneNumber { get; set; } // Phone number.
[J("postalCode")] public string PostalCode { get; set; } // Postal code.
[J("stateProvince")] public string StateProvince { get; set; } // State or province.
[J("xmlSenderId")] public string XmlSenderId { get; set; } // XmlSenderId.
}
public partial class ContactAddress
{
[J("address1")] public string Address1 { get; set; } // Address line 1.
[J("address2")] public string Address2 { get; set; } // Address line 2.
[J("address3")] public string Address3 { get; set; } // Address line 3.
[J("city")] public string City { get; set; } // City.
[J("company")] public string Company { get; set; } // Company name.
[J("country")] public string Country { get; set; } // Country.
[J("faxNumber")] public string FaxNumber { get; set; } // Fax number.
[J("name")] public string Name { get; set; } // Contact name.
[J("phoneNumber")] public string PhoneNumber { get; set; } // Phone number.
[J("postalCode")] public string PostalCode { get; set; } // Postal code.
[J("stateProvince")] public string StateProvince { get; set; } // State or province.
}
public partial class EmailNotificationSubscription
{
[J("emailAddresses")] public string[]? EmailAddresses { get; set; } // Array of email addresses.
[J("emailNotificationTemplateId")] public string EmailNotificationTemplateId { get; set; } // Email notification template identifier.
}
public partial class Parent
{
[J("id")] public string Id { get; set; } // Parent customer identifier.
[J("name")] public string Name { get; set; } // Parent customer name.
}
public partial class ShipMethodMapping
{
[J("fulfillmentSystemShipMethods")] public FulfillmentSystemShipMethod[]? FulfillmentSystemShipMethods { get; set; } // Fulfillment system ship methods.
[J("ratesProviderShipMethodId")] public string RatesProviderShipMethodId { get; set; } // Rates provider ship method identifier.
[J("sourceSystemShipMethodId")] public string SourceSystemShipMethodId { get; set; } // Source system ship method identifier.
[J("trackingUrl")] public string TrackingUrl { get; set; } // Tracking URL.
}
public partial class FulfillmentSystemShipMethod
{
[J("fulfillmentSystemId")] public long? FulfillmentSystemId { get; set; } // Fulfillment system identifier.
[J("fulfillmentSystemName")] public string FulfillmentSystemName { get; set; } // Fulfillment system name.
[J("fulfillmentSystemShipMethodId")] public string FulfillmentSystemShipMethodId { get; set; } // Fulfillment system ship method identifier.
}
public partial class SourceSystem
{
[J("authClientId")] public string AuthClientId { get; set; } // Auth0 client identifier.
[J("clientSecret")] public string ClientSecret { get; set; } // Auth0 client secret.
[J("id")] public long? Id { get; set; } // Source system identifier.
[J("name")] public string Name { get; set; } // Source system name.
[J("sourceSystemCustomerId")] public string SourceSystemCustomerId { get; set; } // This is an automatically generated field added by middleware. It is considered read-only
}
public partial class GetCustomerResponse
{
public static GetCustomerResponse FromJson(string json) => JsonSerializer.Deserialize<GetCustomerResponse>(json, OtpSchema.Api.CustomerBroker.GetCustomerResponse.Converter.Settings);
}
public static class Serialize
{
public static string ToJson(this GetCustomerResponse self) => JsonSerializer.Serialize(self, OtpSchema.Api.CustomerBroker.GetCustomerResponse.Converter.Settings);
}
internal static class Converter
{
public static readonly JsonSerializerOptions Settings = new(JsonSerializerDefaults.General)
{
Converters =
{
new DateOnlyConverter(),
new TimeOnlyConverter(),
IsoDateTimeOffsetConverter.Singleton
},
};
}
public class DateOnlyConverter : JsonConverter<DateOnly>
{
private readonly string serializationFormat;
public DateOnlyConverter() : this(null) { }
public DateOnlyConverter(string? serializationFormat)
{
this.serializationFormat = serializationFormat ?? "yyyy-MM-dd";
}
public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
return DateOnly.Parse(value!);
}
public override void Write(Utf8JsonWriter writer, DateOnly value, JsonSerializerOptions options)
=> writer.WriteStringValue(value.ToString(serializationFormat));
}
public class TimeOnlyConverter : JsonConverter<TimeOnly>
{
private readonly string serializationFormat;
public TimeOnlyConverter() : this(null) { }
public TimeOnlyConverter(string? serializationFormat)
{
this.serializationFormat = serializationFormat ?? "HH:mm:ss.fff";
}
public override TimeOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
return TimeOnly.Parse(value!);
}
public override void Write(Utf8JsonWriter writer, TimeOnly value, JsonSerializerOptions options)
=> writer.WriteStringValue(value.ToString(serializationFormat));
}
internal class IsoDateTimeOffsetConverter : JsonConverter<DateTimeOffset>
{
public override bool CanConvert(Type t) => t == typeof(DateTimeOffset);
private const string DefaultDateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK";
private DateTimeStyles _dateTimeStyles = DateTimeStyles.RoundtripKind;
private string? _dateTimeFormat;
private CultureInfo? _culture;
public DateTimeStyles DateTimeStyles
{
get => _dateTimeStyles;
set => _dateTimeStyles = value;
}
public string? DateTimeFormat
{
get => _dateTimeFormat ?? string.Empty;
set => _dateTimeFormat = (string.IsNullOrEmpty(value)) ? null : value;
}
public CultureInfo Culture
{
get => _culture ?? CultureInfo.CurrentCulture;
set => _culture = value;
}
public override void Write(Utf8JsonWriter writer, DateTimeOffset value, JsonSerializerOptions options)
{
string text;
if ((_dateTimeStyles & DateTimeStyles.AdjustToUniversal) == DateTimeStyles.AdjustToUniversal
|| (_dateTimeStyles & DateTimeStyles.AssumeUniversal) == DateTimeStyles.AssumeUniversal)
{
value = value.ToUniversalTime();
}
text = value.ToString(_dateTimeFormat ?? DefaultDateTimeFormat, Culture);
writer.WriteStringValue(text);
}
public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
string? dateText = reader.GetString();
if (string.IsNullOrEmpty(dateText) == false)
{
if (!string.IsNullOrEmpty(_dateTimeFormat))
{
return DateTimeOffset.ParseExact(dateText, _dateTimeFormat, Culture, _dateTimeStyles);
}
else
{
return DateTimeOffset.Parse(dateText, Culture, _dateTimeStyles);
}
}
else
{
return default(DateTimeOffset);
}
}
public static readonly IsoDateTimeOffsetConverter Singleton = new IsoDateTimeOffsetConverter();
}
}
#pragma warning restore CS8618
#pragma warning restore CS8601
#pragma warning restore CS8603
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "GetCustomerResponse.json",
"type": "object",
"additionalProperties": false,
"properties": {
"data": {
"description": "Customer detail data.",
"type": ["object", "null"],
"additionalProperties": false,
"properties": {
"defaultWarehouseId": { "description": "Default warehouse identifier.", "type": ["string", "null"] },
"id": { "description": "Customer identifier.", "type": ["string", "null"] },
"xmlSenderId": { "description": "XML sender identifier.", "type": ["string", "null"] },
"billingEntities": {
"description": "Billing entities.",
"type": ["array", "null"],
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {"description": "Billing entity identifier.", "type": "string"},
"xmlSenderId": { "description": "XmlSenderId override.", "type": ["string", "null"] },
"addresses": {
"description": "Addresses linked to this billing entity.",
"type": ["array", "null"],
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"xmlSenderId" : { "description": "XmlSenderId." , "type": ["string", "null"] },
"address1" : { "description": "Address line 1." , "type": "string" },
"address2" : { "description": "Address line 2." , "type": ["string", "null"] },
"address3" : { "description": "Address line 3." , "type": ["string", "null"] },
"city" : { "description": "City." , "type": "string" },
"code" : { "description": "Address code." , "type": "string" },
"company" : { "description": "Company name." , "type": ["string", "null"] },
"country" : { "description": "Country." , "type": "string" },
"emailAddress" : { "description": "Email address." , "type": ["string", "null"] },
"faxNumber" : { "description": "Fax number." , "type": ["string", "null"] },
"isBillToDefault": { "description": "Bill-to default flag.", "type": "boolean" },
"isShipToDefault": { "description": "Ship-to default flag.", "type": "boolean" },
"name" : { "description": "Address name." , "type": "string" },
"phoneNumber" : { "description": "Phone number." , "type": ["string", "null"] },
"postalCode" : { "description": "Postal code." , "type": "string" },
"stateProvince" : { "description": "State or province." , "type": "string" }
},
"required": [
"code", "name", "address1", "city", "stateProvince", "postalCode", "country",
"isBillToDefault", "isShipToDefault"
]
}
},
"isDefaultForCustomer": {
"description": "Indicates whether this is the default billing entity for the customer.",
"type": "boolean"
}
},
"required": ["id"]
}
},
"brokerScopes": {
"description": "Broker scopes.",
"type": ["array", "null"],
"items": {"type": "string"}
},
"contactAddress": {
"description": "Contact address.",
"type": ["object", "null"],
"additionalProperties": false,
"properties": {
"address1" : { "description": "Address line 1." , "type": ["string", "null"] },
"address2" : { "description": "Address line 2." , "type": ["string", "null"] },
"address3" : { "description": "Address line 3." , "type": ["string", "null"] },
"city" : { "description": "City." , "type": ["string", "null"] },
"company" : { "description": "Company name." , "type": ["string", "null"] },
"country" : { "description": "Country." , "type": ["string", "null"] },
"faxNumber" : { "description": "Fax number." , "type": ["string", "null"] },
"name" : { "description": "Contact name." , "type": ["string", "null"] },
"phoneNumber" : { "description": "Phone number." , "type": ["string", "null"] },
"postalCode" : { "description": "Postal code." , "type": ["string", "null"] },
"stateProvince": { "description": "State or province.", "type": ["string", "null"] }
}
},
"contactEmailAddress": { "description": "Contact email address.", "type": ["string", "null"] },
"directMailProvider": { "description": "Direct mail provider.", "type": ["string", "null"] },
"doValidateOrderPrice": { "description": "Order price validation flag.", "type": ["boolean", "null"] },
"emailNotificationSubscriptions": {
"description": "Email notification subscriptions.",
"type": ["array", "null"],
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"emailNotificationTemplateId": {
"description": "Email notification template identifier.",
"type": ["string", "null"]
},
"emailAddresses": {
"description": "Array of email addresses.",
"type": ["array", "null"],
"items": {"type": "string"}
}
}
}
},
"emailServiceProvider": { "description": "Email service provider.", "type": ["string", "null"] },
"inheritParentOffers": { "description": "Inherit parent offers flag.", "type": ["boolean", "null"] },
"invoiceEmailAddress": { "description": "Invoice email address.", "type": ["string", "null"] },
"mailingFileLocation": { "description": "Mailing file location.", "type": ["string", "null"] },
"name": { "description": "Customer name.", "type": ["string", "null"] },
"offerRevisionDelimiter": { "description": "Offer revision delimiter.", "type": ["string", "null"] },
"parent": {
"description": "Parent customer reference.",
"type": ["object", "null"],
"additionalProperties": false,
"properties": {
"id" : { "description": "Parent customer identifier.", "type": ["string", "null"] },
"name": { "description": "Parent customer name." , "type": ["string", "null"] }
}
},
"paymentEmailAddress": { "description": "Payment email address.", "type": ["string", "null"] },
"productionFileLocation": { "description": "Production file location.", "type": ["string", "null"] },
"shipMethodMappings": {
"description": "Ship method mappings.",
"type": ["array", "null"],
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"ratesProviderShipMethodId": {
"description": "Rates provider ship method identifier.",
"type": ["string", "null"]
},
"sourceSystemShipMethodId": {
"description": "Source system ship method identifier.",
"type": ["string", "null"]
},
"fulfillmentSystemShipMethods": {
"description": "Fulfillment system ship methods.",
"type": ["array", "null"],
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"fulfillmentSystemId": { "description": "Fulfillment system identifier.", "type": ["integer", "null"] },
"fulfillmentSystemShipMethodId": {
"description": "Fulfillment system ship method identifier.",
"type": ["string", "null"]
},
"fulfillmentSystemName": { "description": "Fulfillment system name.", "type": ["string", "null"] }
}
}
},
"trackingUrl": { "description": "Tracking URL.", "type": ["string", "null"] }
}
}
},
"sourceSystems": {
"description": "Source systems.",
"type": ["array", "null"],
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"authClientId": { "description": "Auth0 client identifier.", "type": ["string", "null"] },
"id": { "description": "Source system identifier.", "type": ["integer", "null"] },
"sourceSystemCustomerId": {
"description": "This is an automatically generated field added by middleware. It is considered read-only",
"type": ["string", "null"],
"readonly": true
},
"clientSecret": { "description": "Auth0 client secret.", "type": ["string", "null"] },
"name": { "description": "Source system name.", "type": ["string", "null"] }
}
}
},
"useDefaultBillingEntity": {
"description": "Use default billing entity flag.",
"type": ["boolean", "null"]
}
}
},
"failureMessages": { "type": "array", "items": {"type": "string"} },
"informationalMessages": { "type": "array", "items": {"type": "string"} },
"operationWasSuccessful": {"type": "boolean"}
},
"required": ["failureMessages", "informationalMessages", "operationWasSuccessful", "data"]
}