/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { WeightUnitEnum, WeightUnitEnum$outboundSchema, } from "./weightunitenum.js"; export type CustomsItemCreateRequest = { /** * Text description of your item. */ description: string; /** * Export Control Classification Number, required on some exports from the United States. */ eccnEar99?: string | undefined; /** * The unit used for weight. */ massUnit: WeightUnitEnum; /** * A string of up to 100 characters that can be filled with any additional information you * * @remarks * want to attach to the object. */ metadata?: string | undefined; /** * Total weight of this item, i.e. quantity * weight per item. */ netWeight: string; /** * Country of origin of the item. Example: `US` or `DE`. * * @remarks * All accepted values can be found on the Official ISO Website. */ originCountry: string; /** * Quantity of this item in the shipment you send. Must be greater than 0. */ quantity: number; /** * SKU code of the item, which is required by some carriers. */ skuCode?: string | undefined; /** * HS code of the item, which is required by some carriers. If `tariff_number` is not provided, `hs_code` will be used. If both `hs_code` and `tariff_number` are provided, `tariff_number` will be used. 50 character limit. */ hsCode?: string | undefined; /** * The tariff number of the item. If `tariff_number` is not provided, `hs_code` will be used. If both `hs_code` and `tariff_number` are provided, `tariff_number` will be used. 12 character limit. */ tariffNumber?: string | undefined; /** * Total value of this item, i.e. quantity * value per item. */ valueAmount: string; /** * Currency used for value_amount. The official ISO 4217 * * @remarks * currency codes are used, e.g. `USD` or `EUR`. */ valueCurrency: string; }; /** @internal */ export type CustomsItemCreateRequest$Outbound = { description: string; eccn_ear99?: string | undefined; mass_unit: string; metadata?: string | undefined; net_weight: string; origin_country: string; quantity: number; sku_code?: string | undefined; hs_code?: string | undefined; tariff_number?: string | undefined; value_amount: string; value_currency: string; }; /** @internal */ export const CustomsItemCreateRequest$outboundSchema: z.ZodMiniType< CustomsItemCreateRequest$Outbound, CustomsItemCreateRequest > = z.pipe( z.object({ description: z.string(), eccnEar99: z.optional(z.string()), massUnit: WeightUnitEnum$outboundSchema, metadata: z.optional(z.string()), netWeight: z.string(), originCountry: z.string(), quantity: z.int(), skuCode: z.optional(z.string()), hsCode: z.optional(z.string()), tariffNumber: z.optional(z.string()), valueAmount: z.string(), valueCurrency: z.string(), }), z.transform((v) => { return remap$(v, { eccnEar99: "eccn_ear99", massUnit: "mass_unit", netWeight: "net_weight", originCountry: "origin_country", skuCode: "sku_code", hsCode: "hs_code", tariffNumber: "tariff_number", valueAmount: "value_amount", valueCurrency: "value_currency", }); }), ); export function customsItemCreateRequestToJSON( customsItemCreateRequest: CustomsItemCreateRequest, ): string { return JSON.stringify( CustomsItemCreateRequest$outboundSchema.parse(customsItemCreateRequest), ); }