sdksio-postnl-ecommerce-apis-sdk
Version:
Collection of PostNL API's for ecommerce processes
67 lines (63 loc) • 4.11 kB
text/typescript
/**
* PostNL Ecommerce APIsLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
import {
array,
boolean,
lazy,
object,
optional,
Schema,
string,
} from '../schema';
import { Content, contentSchema } from './content';
import { CurrencyEnum, currencyEnumSchema } from './currencyEnum';
import { ShipmentTypeEnum, shipmentTypeEnumSchema } from './shipmentTypeEnum';
export interface Custom {
/** Fill in if applicable, for specific items a export certificate is obliged, as proof that the item complies to the sanity regulations, [more information](https://ondernemersplein.kvk.nl/fytosanitair-of-veterinair-exportcertificaat-aanvragen/). Mandatory for Parcel shipments in the category type Commercial Goods, Commercial Sample and Returned Goods (Certificate, Invoice or License; at least 1 out of 3 must be selected) */
certificate?: boolean;
/** Mandatory when Certificate is true. */
certificateNr?: string;
/** Fill in if applicable. Mandatory for Parcel shipments in the category type Commercial Goods, Commercial Sample and Returned Goods (Certificate, Invoice or License; at least 1 out of 3 must be selected). */
license?: boolean;
/** Mandatory when License is true. */
licenseNr?: string;
/** Fill in the invoice number of the shipment. For a faster customs clearing process apply the invoice on the outside of the shipment. Mandatory for Parcel shipments in the category type Commercial Goods, Commercial Sample and Returned Goods (Certificate, Invoice or License; at least 1 out of 3 must be selected). */
invoice?: boolean;
/** Mandatory when Invoice is true */
invoiceNr?: string;
/** Determines what to do when the shipment cannot be delivered the first time (if this is set to true,the shipment will be returned after the first failed attempt) */
handleAsNonDeliverable?: boolean;
/** Currency code. only EUR, GBP, USD and CNY are allowed. */
currency: CurrencyEnum;
/** Type of shipment, possible values: Gift, Documents, Commercial Goods, Commercial Sample, Returned Goods. Is used to fill in the checkbox on the customs form on the shipment label. */
shipmentType: ShipmentTypeEnum;
/** Use only when available. This is the reference of the sender. Depending on the destination with this ID, EORI, IOSS, TAX, VAT, VOEC*, the customs process can be faster. Only fill in this customs reference number if the sender is registrated as Trusted Shipper in the country of destination. *VOEC is a Norwegian VAT number. */
trustedShipperID?: string;
/** This is the reference of the recipient. Fill in a Tax Code or VAT number or Importer code. Depending on the destination with this reference the customs process can be faster. For example Brazil uses an TAXID number for natural persons, known as CPF. */
importerReferenceCode?: string;
/** See the [Reference data](#tag/Reference-codes/Transaction-codes) for possible values. */
transactionCode?: string;
/** Transaction description; see [here](#tag/Reference-codes/Transaction-codes) for common examples. */
transactionDescription?: string;
/** The contents of the shipment. This section is mandatory (minimum once, maximum 5). Fill per unique item. */
content: Content[];
}
export const customSchema: Schema<Custom> = object({
certificate: ['Certificate', optional(boolean())],
certificateNr: ['CertificateNr', optional(string())],
license: ['License', optional(boolean())],
licenseNr: ['LicenseNr', optional(string())],
invoice: ['Invoice', optional(boolean())],
invoiceNr: ['InvoiceNr', optional(string())],
handleAsNonDeliverable: ['HandleAsNonDeliverable', optional(boolean())],
currency: ['Currency', currencyEnumSchema],
shipmentType: ['ShipmentType', shipmentTypeEnumSchema],
trustedShipperID: ['TrustedShipperID', optional(string())],
importerReferenceCode: ['ImporterReferenceCode', optional(string())],
transactionCode: ['TransactionCode', optional(string())],
transactionDescription: ['TransactionDescription', optional(string())],
content: ['Content', array(lazy(() => contentSchema))],
});