Skip to content

Order_Attributes

mauryaratan edited this page Mar 27, 2023 · 2 revisions

Order.Attributes

An object representing the resources data.

public struct Attributes: Codable 

Inheritance

Codable

Properties

storeId

The ID of the store this order belongs to.

public let storeId: Int

customerId

The ID of the customer this subscription belongs to.

public let customerId: Int

identifier

The unique identifier (UUID) for this order.

public let identifier: String

orderNumber

An integer representing the sequential order number for this store.

public let orderNumber: Int

userName

The full name of the customers.

public let userName: String

userEmail

The email address of the customer.

public let userEmail: String

currency

The ISO 4217 currency code for the order (e.g. USD, GBP etc.).

public let currency: String

currencyRate

If the order currency is USD, this will always be 1.0. Otherwise, this is the currency conversion rate used to determine the cost of the order in USD at the time of purchase.

public let currencyRate: String

subtotal

A positive integer in cents representing the subtotal of the order in the order currency.

public let subtotal: Int

discountTotal

A positive integer in cents representing the total discount value applied to the order in the order currency.

public let discountTotal: Int

tax

A positive integer in cents representing the tax applied to the order in the order currency.

public let tax: Int

total

A positive integer in cents representing the total cost of the order in the order currency.

public let total: Int

subtotalUsd

A positive integer in cents representing the subtotal of the order in USD.

public let subtotalUsd: Int

discountTotalUsd

A positive integer in cents representing the total discount value applied to the order in USD.

public let discountTotalUsd: Int

taxUsd

A positive integer in cents representing the tax applied to the order in USD.

public let taxUsd: Int

totalUsd

A positive integer in cents representing the total cost of the order in USD.

public let totalUsd: Int

taxName

If tax is applied to the order, this will be the name of the tax rate (e.g. VAT, Sales Tax, etc).

public let taxName: String?

taxRate

If tax is applied to the order, this will be the rate of tax as a decimal percentage.

public let taxRate: String

status

The status of the order. One of pending, failed, paid, refunded.

public let status: String

statusFormatted

The formatted status of the order.

public let statusFormatted: String

refunded

Has the value true if the order has been refunded.

public let refunded: Int

refundedAt

If the order has been refunded, this will be an ISO-8601 formatted date-time string indicating when the order was refunded.

public let refundedAt: String?

subtotalFormatted

A human-readable string representing the subtotal of the order in the order currency (e.g. $9.99).

public let subtotalFormatted: String

discountTotalFormatted

A human-readable string representing the total discount value applied to the order in the order currency (e.g. $9.99).

public let discountTotalFormatted: String

taxFormatted

A human-readable string representing the tax applied to the order in the order currency (e.g. $9.99).

public let taxFormatted: String

totalFormatted

A human-readable string representing the total cost of the order in the order currency (e.g. $9.99).

public let totalFormatted: String

firstOrderItem

An object representing the first order item belonging to this order.

public let firstOrderItem: FirstOrderItem

createdAt

An ISO-8601 formatted date-time string indicating when the object was created.

public let createdAt: String

updatedAt

An ISO-8601 formatted date-time string indicating when the object was last updated.

public let updatedAt: String
Types
Global Functions
Clone this wiki locally