import * as z from "zod/v4-mini";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import { CoreRate, CoreRate$Outbound } from "./corerate.js";
import { LabelFileTypeEnum } from "./labelfiletypeenum.js";
import { ObjectStateEnum } from "./objectstateenum.js";
import { ResponseMessage, ResponseMessage$Outbound } from "./responsemessage.js";
import { TrackingStatusEnum } from "./trackingstatusenum.js";
import { TransactionStatusEnum } from "./transactionstatusenum.js";
/**
* An object with details about the user who created the Transaction (purchased the label).
*
* @remarks
* A value will be returned only for Transactions that can be associated with a specific user, e.g. when a logged-in
* user purchases a label via the Shippo Web application; but not for Transactions purchased e.g. via the API using a ShippoToken,
* which is associated with the account but not any specific user.
*/
export type CreatedBy = {
firstName?: string | undefined;
lastName?: string | undefined;
username?: string | undefined;
};
/**
* ID of the Rate object for which a Label has to be obtained.
*
* @remarks
* If you purchase a label by calling the transaction endpoint without a rate (instalabel),
* this field will be a simplified Rate object in the Transaction model returned from the POST request.
* Note, only rates less than 7 days old can be purchased to ensure up-to-date pricing.
*/
export type TransactionRate = CoreRate | string;
export type Transaction = {
/**
* A URL pointing to the commercial invoice as a 8.5x11 inch PDF file.
*
* @remarks
* A value will only be returned if the Transactions has been processed successfully and if the shipment is international.
*/
commercialInvoiceUrl?: string | undefined;
createdBy?: CreatedBy | null | undefined;
/**
* The estimated time of arrival according to the carrier.
*/
eta?: string | undefined;
/**
* Print format of the label. If empty, will use the default format set from
*
* @remarks
* the Shippo dashboard.
*/
labelFileType?: LabelFileTypeEnum | undefined;
/**
* A URL pointing directly to the label in the format you've set in your settings.
*
* @remarks
* A value will only be returned if the Transactions has been processed successfully.
*/
labelUrl?: string | undefined;
messages?: Array | undefined;
/**
* A string of up to 100 characters that can be filled with any additional information you want to
*
* @remarks
* attach to the object.
*/
metadata?: string | undefined;
/**
* Date and time of Transaction creation.
*/
objectCreated?: Date | undefined;
/**
* Unique identifier of the given Transaction object.
*/
objectId?: string | undefined;
/**
* Username of the user who created the Transaction object.
*/
objectOwner?: string | undefined;
/**
* Indicates the validity of the enclosing object
*/
objectState?: ObjectStateEnum | undefined;
/**
* Date and time of last Transaction update.
*/
objectUpdated?: Date | undefined;
/**
* Object ID of the Parcel object that is being shipped.
*/
parcel?: string | undefined;
/**
* A URL pointing directly to the QR code in PNG format.
*
* @remarks
* A value will only be returned if requested using qr_code_requested flag and the carrier provides such an option.
*/
qrCodeUrl?: string | undefined;
/**
* ID of the Rate object for which a Label has to be obtained.
*
* @remarks
* If you purchase a label by calling the transaction endpoint without a rate (instalabel),
* this field will be a simplified Rate object in the Transaction model returned from the POST request.
* Note, only rates less than 7 days old can be purchased to ensure up-to-date pricing.
*/
rate?: CoreRate | string | undefined;
/**
* Indicates the status of the Transaction.
*/
status?: TransactionStatusEnum | undefined;
/**
* Indicates whether the object has been created in test mode.
*/
test?: boolean | undefined;
/**
* The carrier-specific tracking number that can be used to track the Shipment.
*
* @remarks
* A value will only be returned if the Rate is for a trackable Shipment and if the Transactions has been processed successfully.
*/
trackingNumber?: string | undefined;
/**
* Indicates the high level status of the shipment.
*/
trackingStatus?: TrackingStatusEnum | undefined;
/**
* A link to track this item on the carrier-provided tracking website.
*
* @remarks
* A value will only be returned if tracking is available and the carrier provides such a service.
*/
trackingUrlProvider?: string | undefined;
};
/** @internal */
export declare const CreatedBy$inboundSchema: z.ZodMiniType;
/** @internal */
export type CreatedBy$Outbound = {
first_name?: string | undefined;
last_name?: string | undefined;
username?: string | undefined;
};
/** @internal */
export declare const CreatedBy$outboundSchema: z.ZodMiniType;
export declare function createdByToJSON(createdBy: CreatedBy): string;
export declare function createdByFromJSON(jsonString: string): SafeParseResult;
/** @internal */
export declare const TransactionRate$inboundSchema: z.ZodMiniType;
/** @internal */
export type TransactionRate$Outbound = CoreRate$Outbound | string;
/** @internal */
export declare const TransactionRate$outboundSchema: z.ZodMiniType;
export declare function transactionRateToJSON(transactionRate: TransactionRate): string;
export declare function transactionRateFromJSON(jsonString: string): SafeParseResult;
/** @internal */
export declare const Transaction$inboundSchema: z.ZodMiniType;
/** @internal */
export type Transaction$Outbound = {
commercial_invoice_url?: string | undefined;
created_by?: CreatedBy$Outbound | null | undefined;
eta?: string | undefined;
label_file_type?: string | undefined;
label_url?: string | undefined;
messages?: Array | undefined;
metadata?: string | undefined;
object_created?: string | undefined;
object_id?: string | undefined;
object_owner?: string | undefined;
object_state?: string | undefined;
object_updated?: string | undefined;
parcel?: string | undefined;
qr_code_url?: string | undefined;
rate?: CoreRate$Outbound | string | undefined;
status?: string | undefined;
test?: boolean | undefined;
tracking_number?: string | undefined;
tracking_status?: string | undefined;
tracking_url_provider?: string | undefined;
};
/** @internal */
export declare const Transaction$outboundSchema: z.ZodMiniType;
export declare function transactionToJSON(transaction: Transaction): string;
export declare function transactionFromJSON(jsonString: string): SafeParseResult;
//# sourceMappingURL=transaction.d.ts.map