# Common API data types Common API Types used within multiple API resources. ## References #### Reference [type definition](/api/types.md?urn=ctp:api:type:Reference). #### KeyReference [type definition](/api/types.md?urn=ctp:api:type:KeyReference). #### ResourceIdentifier [type definition](/api/types.md?urn=ctp:api:type:ResourceIdentifier). #### ReferenceTypeId [type definition](/api/types.md?urn=ctp:api:type:ReferenceTypeId). ## Prices This section contains representations for prices that are embedded into [ProductVariants](/api/projects/products.md#productvariant) and [Line Items](/api/projects/carts.md#lineitem), as well as common data types for [Embedded Prices](/api/pricing-and-discounts-overview.md#embedded-prices) and [Standalone Prices](/api/projects/standalone-prices.md#standaloneprice). The representations specific to Standalone Prices are documented on their [dedicated page](/api/projects/standalone-prices.md#representations). #### Price This type is equivalent to ProductPrice in the [GraphQL API](/api/graphql/). [type definition](/api/types.md?urn=ctp:api:type:Price). #### PriceDraft This type is equivalent to ProductPriceDataInput in the [GraphQL API](/api/graphql/). [type definition](/api/types.md?urn=ctp:api:type:PriceDraft). #### PriceKeyReference [type definition](/api/types.md?urn=ctp:import:type:PriceKeyReference). #### PriceTier [type definition](/api/types.md?urn=ctp:api:type:PriceTier). #### PriceTierDraft This type is equivalent to ProductPriceTierInput in the [GraphQL API](/api/graphql/). [type definition](/api/types.md?urn=ctp:api:type:PriceTierDraft). #### DiscountedPrice [type definition](/api/types.md?urn=ctp:api:type:DiscountedPrice). #### DiscountedPriceDraft This type is equivalent to DiscountedProductPriceValueInput in the [GraphQL API](/api/graphql/). [type definition](/api/types.md?urn=ctp:api:type:DiscountedPriceDraft). ## Monetary values Currencies can have up to three fraction digits. While most currencies (like USD and EUR) have two fraction digits, some currencies have three fraction digits (like JOB) or no fraction digits (like JPY). The smallest amount used in financial transactions is the cent, for currencies such as EUR and USD. However, in some cases, unit prices are specified in sub-cents—for example, a gas station displaying the gas price as €1,197 per liter. With [Money](/api/types.md#money), you can only model prices (such as €1,19) that use the default number of fraction digits for a currency. To define prices that use more fraction digits than the default, use [HighPrecisionMoneyDraft](/api/types.md#highprecisionmoneydraft). If you define a higher number of fraction digits for a price, fewer integer digits will be available—for example, if `"fractionDigits": 20`, the highest expressible amount is approximately 9 cents. The following table shows how `fractionDigits` affect a `preciseAmount`: | preciseAmount | fractionDigits | Amount in currency (€) | | --- | --- | --- | | 123456 | 3 | 123,456 | | 123456 | 5 | 1,23456 | | 123456 | 7 | 0,0123456 | #### TypedMoney This type is equivalent to BaseMoney in the [GraphQL API](/api/graphql/). Polymorphic base read-only money type that holds money in [cent precision](/api/types.md#centprecisionmoney) or [high precision](/api/types.md#highprecisionmoney) (in sub-cents). ##### CentPrecisionMoney This type is equivalent to Money in the [GraphQL API](/api/graphql/). [type definition](/api/types.md?urn=ctp:api:type:CentPrecisionMoney). ##### HighPrecisionMoney This type is equivalent to HighPrecisionMoney in the [GraphQL API](/api/graphql/). [type definition](/api/types.md?urn=ctp:api:type:HighPrecisionMoney). #### TypedMoneyDraft This type is equivalent to BaseMoneyInput in the [GraphQL API](/api/graphql/). Polymorphic base money type that can hold money in cent precision or high precision (in sub-cents). - To set money in cent precision, use [Money](/api/types.md#money). - To set money in high precision, use [HighPrecisionMoneyDraft](/api/types.md#highprecisionmoneydraft). ##### Money This type is equivalent to MoneyInput or MoneyDraft in the [GraphQL API](/api/graphql/). [type definition](/api/types.md?urn=ctp:api:type:Money). ##### HighPrecisionMoneyDraft This type is equivalent to HighPrecisionMoneyInput in the [GraphQL API](/api/graphql/). [type definition](/api/types.md?urn=ctp:api:type:HighPrecisionMoneyDraft). #### MoneyType [type definition](/api/types.md?urn=ctp:api:type:MoneyType). ## Date and Time #### Date A `Date` is a JSON string representation of a date without timezone in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (YYYY-MM-DD), for example: ```json "2018-10-12" ``` #### Time A `Time` is a JSON string representation of a time without timezone in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (hh:mm:ss.sss), for example: ```json "14:00:00.000" ``` #### DateTime A `DateTime` is a JSON string representation of UTC date & time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (YYYY-MM-DDThh:mm:ss.sssZ), for example: ```json "2018-10-12T14:00:00.000Z" ``` ## Localization #### CountryCode [type definition](/api/types.md?urn=ctp:api:type:CountryCode). #### CurrencyCode [type definition](/api/types.md?urn=ctp:api:type:CurrencyCode). ##### NonStandardCurrency [type definition](/api/types.md?urn=ctp:api:type:NonStandardCurrency). #### Locale [type definition](/api/types.md?urn=ctp:api:type:Locale). #### LocalizedString JSON object where the keys are of type [Locale](/api/types.md#locale), and the values are the strings used for the corresponding language. ```json { "de": "Hundefutter", "en": "dog food" } ``` #### GeoJSON Geometry Representation of a [Geometry Object](https://datatracker.ietf.org/doc/html/rfc7946#section-3.1) as defined in the GeoJSON standard. Currently, only the [Point](https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.2) type is supported. ##### Point [type definition](/api/types.md?urn=ctp:api:type:GeoJsonPoint). ## Addresses #### BaseAddress [type definition](/api/types.md?urn=ctp:api:type:BaseAddress). ##### Address [type definition](/api/types.md?urn=ctp:api:type:Address). ##### AddressDraft This type is equivalent to AddressInput in the [GraphQL API](/api/graphql/). [type definition](/api/types.md?urn=ctp:api:type:AddressDraft). ##### AddressRole [type definition](/api/types.md?urn=ctp:api:type:AddressRole). ## Assets Assets can be used to represent media assets, such as images, videos, or PDFs. Learn more about images in our self-paced Images and Assets module. #### Asset [type definition](/api/types.md?urn=ctp:api:type:Asset). #### AssetDraft [type definition](/api/types.md?urn=ctp:api:type:AssetDraft). #### AssetSource [type definition](/api/types.md?urn=ctp:api:type:AssetSource). #### AssetDimensions [type definition](/api/types.md?urn=ctp:api:type:AssetDimensions). ## Client logging These objects represent information about which [API Client](/api/projects/api-clients.md) created or modified a resource. For more information, see [Client Logging](/api/general-concepts.md#client-logging). #### CreatedBy [type definition](/api/types.md?urn=ctp:api:type:CreatedBy). #### LastModifiedBy [type definition](/api/types.md?urn=ctp:api:type:LastModifiedBy). #### Attribution [type definition](/api/types.md?urn=ctp:api:type:Attribution). #### AttributionSource [type definition](/api/types.md?urn=ctp:api:type:AttributionSource). ## Warnings #### WarningObject [type definition](/api/types.md?urn=ctp:api:type:WarningObject). ##### ImageProcessingOngoing Warning [type definition](/api/types.md?urn=ctp:api:type:ImageProcessingOngoingWarning). ##### CannotCreateReservation Warning [type definition](/api/types.md?urn=ctp:api:type:CannotCreateReservationWarning). ##### CannotUpdateReservation Warning [type definition](/api/types.md?urn=ctp:api:type:CannotUpdateReservationWarning). ##### CannotChangeReservationExpiry Warning [type definition](/api/types.md?urn=ctp:api:type:CannotChangeReservationExpiryWarning). ## Related pages - [Area overview page with navigation](/api.md) - [Previous page: General concepts](/api/general-concepts.md) - [Next page: Query Predicates](/api/predicates/query.md)