Shopify APIとデータモデルのRESTからGRAPHQLへの移行による主な変更点(Orders関連)

Shopify-Rest2GraphQL-Orders.png

こんにちは。プロダクトチームの周です。

Shopify REST Admin API は2024年10月1日をもってレガシーとなったことに伴い、Shopify 連携のCData 製品でご利用のデータモデルについて、「REST Data Model」から「GRAPHQL Data Model」への移行を強くお勧めいたします。REST とGRAPHQL データモデルでは、利用可能なテーブル、ビュー、ストアドプロシージャに仕様上の違いが数多くありますため、GRAPHQL への移行に際しては、これらの違いを十分にご確認いただいた上で、計画的な移行を実施していただく必要があります。本記事ではGRAPHQL への移行による主な変更点(Orders関連)を案内いたします。

※Productsに関連する主な変更点はこちらのブログ記事をご参照ください。

※Fulfillment,Inventory,Customersに関連する主な変更点はこちらのブログ記事をご参照ください。

目次

◆ Orders (REST) → (GRAPHQL) Orders

REST-2024-10.
Orders
GRAPHQL-2024-10.
Orders
GRAPHQLに関する注記
AppliedDiscountAmount DraftOrders.AppliedDiscountAmountV2Amount  
AppliedDiscountDescription DraftOrders.AppliedDiscountDescription  
AppliedDiscountTitle DraftOrders.AppliedDiscountTitle  
AppliedDiscountValue DraftOrders.AppliedDiscountValue  
AppliedDiscountValueType DraftOrders.AppliedDiscountValueType  
BillingAddressCountryCode BillingAddressCountryCodeV2  
BillingAddressDefault ✕ (GRAPHQL未対応)  
BrowserIp ClientIp  
BuyerAcceptsMarketing CustomerAcceptsMarketing  
CartToken ✕ (GRAPHQL未対応)  
CheckoutId ✕ (GRAPHQL未対応)
CheckoutToken ✕ (GRAPHQL未対応)
Currency CurrencyCode  
CurSubtotalPriceSetPresentmentMoneyAmount CurrentSubtotalPriceSetPresentmentMoneyAmount  
CurSubtotalPriceSetShopMoneyAmount CurrentSubtotalPriceSetShopMoneyAmount  
CurTotalAdditionalFeesSetPresentmentMoneyAmount CurrentTotalDiscountsSetPresentmentMoneyAmount  
CurTotalAdditionalFeesSetShopMoneyAmount CurrentTotalAdditionalFeesSetShopMoneyAmount  
CurTotalDiscountsSetPresentmentMoneyAmount CurrentTotalDiscountsSetPresentmentMoneyAmount  
CurTotalDiscountsSetShopMoneyAmount CurrentTotalDiscountsSetShopMoneyAmount  
DiscountApplicationsAggregate OrderDiscountApplications.*  
FinancialStatus DisplayFinancialStatus  
FulfillmentAggregate Fulfillments.*  
FulfillmentStatus DisplayFulfillmentStatus  
Id Id , LegacyResourceId GRAPHQLの「Id」はRESTと異なるフォーマットを持つグローバルID。
InventoryBehaviour 未対応
InvoiceUrl DraftOrders.InvoiceUrl  
LandingSite CustomerJourneySummaryFirstVisitLandingPage
CustomerJourneySummaryLastVisitLandingPage
 
LineAggregate OrderLineItems.*  
LocationId PhysicalLocationId  
NoteAttributesAggregate OrderCustomAttributes.*  
Number ✕ (GRAPHQL未対応)
Operation 未対応
OrderStatusUrl 未対応
OrigTotalAdditionalFeesSetPresentmentMoneyAmount OriginalTotalAdditionalFeesSetPresentmentMoneyAmount  
OrigTotalAdditionalFeesSetShopMoneyAmount OriginalTotalAdditionalFeesSetShopMoneyAmount  
PaymentTermsAmount ✕ (GRAPHQL未対応)  
PaymentTermsCurrency ✕ (GRAPHQL未対応)  
PaymentTermsPaymentSchedules 未対応
PresentmentCurrency PresentmentCurrencyCode
ReferringSite CustomerJourneySummaryFirstVisitReferrerUrl
CustomerJourneySummaryLastVisitReferrerUrl
RefundAggregate Refunds.*
SendFulfillmentReceipt 未対応
SendReceipt 未対応
ShippingAddressCountryCode ShippingAddressCountryCodeV2  
ShippingAddressDefault ✕ (GRAPHQL未対応)  
ShippingAggregate ShippingLine*  
SourceName 未対応
SubtotalPrice SubtotalPriceSetShopMoneyAmount
TaxAggregate OrderTaxLines.*  
TaxExempt DraftOrders.TaxExempt  
Token ✕ (GRAPHQL未対応)  
TotalDiscounts TotalDiscountsSetShopMoneyAmount  
TotalLineItemsPriceSetPresentmentMoneyAmount SubtotalPriceSetPresentmentMoneyAmount  
TotalLineItemsPriceSetShopMoneyAmount SubtotalPriceSetShopMoneyAmount  
TotalOrderItemsPrice SubtotalPriceSetShopMoneyAmount  
TotalOutstanding TotalOutstandingSetShopMoneyAmount  
TotalPrice TotalPriceSetShopMoneyAmount  
TotalSubtotalSetPresentmentMoneyAmount SubtotalPriceSetPresentmentMoneyAmount  
TotalSubtotalSetShopMoneyAmount SubtotalPriceSetShopMoneyAmount  
TotalTax TotalTaxSetShopMoneyAmount  
TotalTipReceived TotalTipReceivedSetShopMoneyAmount  

◆ OrdersItems (REST) → (GRAPHQL) OrderLineItems

REST-2024-10.
OrdersItems
GRAPHQL-2024-10.
OrderLineItems
GRAPHQLに関する注記
AppliedDiscountAmount DraftOrderLineItems.AppliedDiscountAmountV2Amount  
AppliedDiscountDescription DraftOrderLineItems.AppliedDiscountDescription  
AppliedDiscountTitle DraftOrderLineItems.AppliedDiscountTitle  
AppliedDiscountValue DraftOrderLineItems.AppliedDiscountValue  
AppliedDiscountValueType DraftOrderLineItems.AppliedDiscountValueType  
FulfillableQuantity
FulFillmentsService Location.FulfillmentServiceId ProductVariants.Id = OrderLineItems.VariantId
InventoryItemInventoryLevels.InventoryItemId = ProductVariants.InventoryItemId
InventoryItemInventoryLevels.LocationId = Location.Id
FulfillmentStatus 未対応(GRAPHQL非推奨)
→ Orders.DisplayFulfillmentStatus
GiftCard IsGiftCard  
ItemGrams → ProductVariants.InventoryItemMeasurementWeight*  
ItemId Id GRAPHQLの「Id」はRESTと異なるフォーマットを持つグローバルID。
ItemPrice OriginalUnitPriceSetShopMoneyAmount  
ItemQuantity Quantity  
ItemTitle Title  
ItemVariantId ProductVariants.LegacyResourceId ProductVariants.Id = OrderLineItems.VariantId
OrderId Orders.LegacyResourceId Orders.Id = OrderLineItems.ResourceId
OrderUpdatedAt OrderUpdatedAt ※最新ビルドにて対応
ProductId Products.LegacyResourceId Products.Id =  OrderLineItems.ProductId
Properties OrderLineItemCustomAttributes.*  
TotalDiscount TotalDiscountSetShopMoneyAmount  

◆ NoteAttributes (REST) → (GRAPHQL) OrderCustomAttributes

REST-2024-10.
NoteAttributes
GRAPHQL-2024-10.
OrderCustomAttributes
GRAPHQLに関する注記
Name Key  
OrderId Orders.LegacyResourceId  Orders.Id = OrderCustomAttributes.ResourceId


◆ OrderItemProperties (REST) → (GRAPHQL) OrderLineItemCustomAttributes

REST-2024-10.
OrderItemProperties
GRAPHQL-2024-10.
OrderLineItemCustomAttributes
GRAPHQLに関する注記
ItemId ResourceId GRAPHQLの「Id」はRESTと異なるフォーマットを持つグローバルID。
Name Key  
OrderId Orders.LegacyResourceId OrderLineItems.ResourceId = Orders.Id
OrderLineItems.Id = OrderLineItemCustomAttributes.ResourceId
OrderUpdatedAt Orders.UpdatedAt  

◆ OrderDiscountCodes (REST) → (GRAPHQL) OrderDiscountApplications

REST-2024-10.
OrderItemDiscountAllocations
GRAPHQL-2024-10.
OrderLineItemDiscountAllocations
GRAPHQLに関する注記
Amount AllocatedAmountSetShopMoneyAmount  
ApplicationIndex DiscountApplicationIndex  
ItemId OrderLineItemId GRAPHQLの「Id」はRESTと異なるフォーマットを持つグローバルID。
OrderId Orders.LegacyResourceId OrderLineItems.ResourceId = Orders.Id
OrderLineItems.Id = OrderLineItemDiscountAllocations.OrderLineItemId
OrderUpdatedAt Orders.UpdatedAt  
PresentmentMoneyAmount AllocatedAmountSetPresentmentMoneyAmount  
PresentmentMoneyCurrencyCode AllocatedAmountSetPresentmentMoneyCurrencyCode  
ShopMoneyAmount AllocatedAmountSetShopMoneyAmount  
ShopMoneyCurrencyCode AllocatedAmountSetShopMoneyCurrencyCode  

◆ OrderItemDiscountAllocations (REST) → (GRAPHQL) OrderLineItemDiscountAllocations

REST-2024-10.
OrderDiscountCodes
→ GRAPHQL-2024-10.
OrderDiscountApplications
GRAPHQLに関する注記
Amount → OrderLineItemDiscountAllocations.AllocatedAmountSetShopMoneyAmount OrderLineItems.ResourceId = OrderDiscountApplications.OrderId
OrderLineItems.Id = OrderLineItemDiscountAllocations.OrderLineItemId
Code DiscountCodeApplicationCode | ManualDiscountApplicationTitle NULLではない方の値 (関連項目:Orders.DiscountCodes)
OrderId OrderId GRAPHQLの「Id」はRESTと異なるフォーマットを持つグローバルID。
OrderUpdatedAt Orders.UpdatedAt  
Type ValueAmount | ValuePercentage → (fixed_amount | percentage) NULLではない方のタイプ

おわりに

本記事ではShopify API とデータモデルのREST からGRAPHQL への移行による主な変更点(Orders関連)を紹介しました。全ての変更点を網羅したリストではありませんが、ご不明な点がございましたら、お気軽に弊社サポートデスクにお問い合わせください。引き続きCData 製品をShopify へのデータ連携でご活用ください。

CData Shopify Drivers は30日間の無償トライアルが可能です。ぜひお試しくださいませ。
https://www.cdata.com/jp/drivers/shopify

トライアル・お問い合わせ

関連コンテンツ