3. Object & Field Mapping
Understand which fields map from the REST based return payloads to the equivalent GraphQL return payloads.
7 minute read
Introduction
In this section we map the fields returned by the REST endpoints to its equivalent in the GraphQL schema.
Best fit
While we provide the relevant field mappings, as you explore the GraphQL API you may find alternate fields to solve for your use-case. The suggestions we provide here are the general “best-fit”, but of course you can use whatever GraphQL field best suits your needs.Adverts
List Adverts
GET /api/v2/client/adverts
REST Field | GraphQL Object | GraphQL Field | |
---|---|---|---|
data.id | Advert | legacyId | |
data.attributes.title | Advert | title | |
data.attributes.description | Advert | description | |
data.attributes.sale_type | Advert | saleType | |
data.attributes.published | Advert | published | |
data.attributes.code | Advert | code | |
data.attributes.sale_price | Advert | lowestPrice | |
data.attributes.price | Advert | lowestOriginalPrice | |
data.attributes.condition | Advert | condition | |
data.attributes.year | Advert | year | |
data.attributes.external_id | Advert | externalId | |
data.attributes.notes | Advert | N/a | |
data.attributes.specifications | Advert | specifications | |
data.attributes.domestic_shipping_cost | Advert | baseDomesticShippingCost | |
data.attributes.international_shipping_cost | Advert | baseInternationalShippingCost | |
data.attributes.youtube_video_url | Advert | youtubeVideoUrl | |
data.attributes.origin_country_code | Advert | originCountryCode | |
data.attributes.tax_code | Advert | taxCode | |
data.attributes.therapeutic_goods_labelling_enabled | Advert | therapeuticGoodsLabellingEnabled | |
data.max_purchase_quantity | Advert | maxPurchaseQuantity | |
data.min_purchase_quantity | Advert | minPurchaseQuantity | |
data.item_tax_rate | Advert | itemTaxRate | |
data.item_tax_rate_percentage | Advert | N/a | |
data.vetted | Advert | vetted | |
data.vetting_rejected_reason | Advert | vettingRejectedReason | |
data.features.product_features | Advert | productFeatures | |
data.features.product_details | Advert | advertOptionValues.nodes.optionValue.name advertOptionValues.nodes.optionType.name | |
data.relationships.taxon.data.type | Advert | taxonNullable | |
data.relationships.taxon.data.id | Advert | taxonNullable.legacyId | |
data.relationships.brand.data.type | Advert | brand | |
data.relationships.taxon.data.id | Advert | N/a |
Single Advert with Variants
GET /api/v2/client/adverts/1/?include=variants
REST Field | GraphQL Object | GraphQL Field | |
---|---|---|---|
data.id | Advert | legacyId | |
data.attributes.title | Advert | title | |
data.attributes.description | Advert | description | |
data.attributes.sale_type | Advert | saleType | |
data.attributes.published | Advert | published | |
data.attributes.code | Advert | code | |
data.attributes.sale_price | Advert | lowestPrice | |
data.attributes.price | Advert | lowestOriginalPrice | |
data.attributes.condition | Advert | condition | |
data.attributes.year | Advert | year | |
data.attributes.external_id | Advert | externalId | |
data.attributes.notes | Advert | N/a | |
data.attributes.specifications | Advert | specifications | |
data.attributes.domestic_shipping_cost | Advert | baseDomesticShippingCost | |
data.attributes.international_shipping_cost | Advert | baseInternationalShippingCost | |
data.attributes.youtube_video_url | Advert | youtubeVideoUrl | |
data.attributes.origin_country_code | Advert | originCountryCode | |
data.attributes.tax_code | Advert | taxCode | |
data.attributes.therapeutic_goods_labelling_enabled | Advert | therapeuticGoodsLabellingEnabled | |
data.max_purchase_quantity | Advert | maxPurchaseQuantity | |
data.min_purchase_quantity | Advert | minPurchaseQuantity | |
data.item_tax_rate | Advert | itemTaxRate | |
data.item_tax_rate_percentage | Advert | N/a | |
data.vetted | Advert | vetted | |
data.vetting_rejected_reason | Advert | vettingRejectedReason | |
data.features.product_features | Advert | productFeatures | |
data.features.product_details | Advert | advertOptionValues.nodes.optionValue.name advertOptionValues.nodes.optionType.name | |
data.relationships.taxon.data.type | Advert | taxonNullable | |
data.relationships.taxon.data.id | Advert | taxonNullable.legacyId | |
data.relationships.brand.data.type | Advert | brand | |
data.relationships.taxon.data.id | Advert | N/a | |
data.relationships.variants.data.type | Advert | variants | |
data.relationships.variants.data.id | Advert | variants.nodes.legacyId | |
Included Taxons | |||
included.attributes.name | Advert | taxonNullable.displayName | |
included.attributes.tree_name | Advert | taxonNullable.treeName | |
included.attributes.slug | Advert | taxonNullable.urlSlug | |
included.attributes.taxon_type | Advert | taxonNullable.taxonType | |
Included Brands | |||
included.attributes.name | Advert | taxonNullable.name | |
included.attributes.slug | Advert | taxonNullable.slug | |
Include Variants | |||
included.id | Advert | variants.nodes.legacyId | |
included.attributes.sku | Advert | variants.nodes.sku | |
included.attributes.count_on_hand | Advert | variants.nodes.countOnHand | |
included.attributes.notes | Advert | variants.nodes.notes | |
included.attributes.external_id | Advert | variants.nodes.externalId | |
included.attributes.sale_price | Advert | variants.nodes.lowestPrice | |
included.attributes.price | Advert | variants.nodes.lowestOriginalPrice | |
included.attributes.barcode | Advert | variants.nodes.barcode | |
included.attributes.ean | Advert | Deprecated: Use barcode | |
included.attributes.upc | Advert | Deprecated: Use barcode | |
included.attributes.advert_id | Advert | variants.nodes.advert.legacyId | |
included.attributes.infinite | Advert | variants.nodes.infiniteQuantity | |
included.attributes.tax_code | Advert | variants.nodes.taxCode | |
included.attributes.item_tax_rate | Advert | variants.nodes.itemTaxRate | |
included.attributes.item_tax_rate_percentage | Advert | N/a | |
included.attributes.administrative_body_warning | Advert | variants.nodes.administrativeBodyWarning | |
included.attributes.intended_purpose | Advert | variants.nodes.intendedPurpose | |
included.attributes.ingredients | Advert | variants.nodes.ingredients | |
included.attributes.directions | Advert | variants.nodes.directions | |
included.attributes.storage_instructions | Advert | variants.nodes.storageInstructions | |
included.attributes.suitable_for | Advert | variants.nodes.suitableFor | |
included.attributes.product_warnings | Advert | variants.nodes.productWarnings | |
included.attributes.health_warnings | Advert | variants.nodes.healthWarnings | |
included.attributes.allergen_contains | Advert | variants.nodes.allergenContains | |
included.attributes.allergen_may_contain | Advert | variants.nodes.allergenMayContain | |
included.attributes.nutritional_information | Advert | variants.nodes.nutritionInformation | |
included.attributes.min_purchase_quantity | Advert | variants.nodes.maxPurchaseQuantity | |
included.attributes.max_purchase_quantity | Advert | variants.nodes.minPurchaseQuantity | |
included.attributes.item_size | Advert | variants.nodes.itemSize | |
included.attributes.comparable_size | Advert | variants.nodes.comparableSize | |
included.attributes.name | Advert | variants.nodes.label | |
included.attributes.width | Advert | Deprecated: use shippingParcel.width | |
included.attributes.length | Advert | Deprecated: use shippingParcel.length | |
included.attributes.depth | Advert | Deprecated: use shippingParcel.depth | |
included.attributes.weight | Advert | Deprecated: use shippingParcel.width.weight | |
included.attributes.master | Advert | N/a | |
included.attributes.item_unit | Advert | variants.nodes.itemUnit | |
included.attributes.comparable_unit | Advert | variants.nodes.comparableUnit |
Brands
List Brands
GET /api/v2/brands
REST Field | GraphQL Object | GraphQL Field |
---|---|---|
data.type | Brand | __typename |
data.id | Brand | N/a |
data.attributes.name | Brand | name |
data.attributes.slug | Brand | slug |
Images
Show a single image
GET /api/v2/client/adverts/1/images/1
REST Field | GraphQL Object | GraphQL Field |
---|---|---|
data.type | Image | __typename |
data.id | Image | N/a |
data.attributes.path | Image | N/a |
data.attributes.filename | Image | filename |
data.attributes.url | Image | url |
Documents
List documents
`GET /api/v2/client/adverts/1/documents/``
REST Field | GraphQL Object | GraphQL Field |
---|---|---|
data.type | AdvertDocument | __typename |
data.id | AdvertDocument | N/a |
data.attributes.path | AdvertDocument | N/a |
data.attributes.filename | AdvertDocument | filename |
data.attributes.url | AdvertDocument | url |
Inventory (multi-store)
Listing a variants inventory
GET /api/v2/client/variants/1/inventories
REST Field | GraphQL Object | GraphQL Field |
---|---|---|
data.type | Inventory | __typename |
data.id | Inventory | N/a |
data.attributes.count_on_hand | Inventory | countOnHand |
data.attributes.price | Inventory | price |
data.attributes.sale_price | Inventory | salePrice |
data.attributes.infinite | Inventory | infiniteQuantity |
data.attributes.seller_id | Inventory | seller.legacyId |
data.attributes.fulfilment_provider | Inventory | N/a |
Invoices
Listing invoices
GET /api/v2/client/invoices
REST Field | GraphQL Object | GraphQL Field |
---|---|---|
data.id | Invoice | legacyId |
data.type | Invoice | __typename |
data.attributes.postage | Invoice | shippingCostCents |
data.attributes.postage_before_discount | Invoice | N/a |
data.attributes.paid_at | Invoice | paidAt |
data.attributes.status | Invoice | Deprecated: use statusFlags |
data.attributes.delivery_type | Invoice | N/a |
data.attributes.ready_at | Invoice | N/a |
data.attributes.collected_at | Invoice | N/a |
data.attributes.subtotal | Invoice | subTotalCents |
data.attributes.discount | Invoice | discountCents |
data.attributes.total | Invoice | totalCents |
data.attributes.tax_on_postage | Invoice | taxShippingCents |
data.attributes.tax_total | Invoice | taxTotalCents |
data.attributes.created_at | Invoice | createdAt |
data.attributes.external_id | Invoice | N/a |
data.attributes.tax_inclusive | Invoice | N/a |
data.attributes.message_to_seller | Invoice | buyerMessageToSeller |
data.attributes.seller_id | Invoice | seller.legacyId |
data.attributes.postage_tracking | Invoice | shipments.trackingNumber |
data.attributes.postage_carrier | Invoice | shipments.carrier |
data.attributes.external_ids | Invoice | externalIds.key externalIds.value |
data.attributes.metadata | Invoice | metadata.key metadata.value |
Show a single invoice
GET /api/v2/client/invoices/1?include=line_items,customer
REST Field | GraphQL Object | GraphQL Field |
---|---|---|
data.id | Invoice | legacyId |
data.type | Invoice | __typename |
data.attributes.postage | Invoice | shippingCostCents |
data.attributes.postage_before_discount | Invoice | N/a |
data.attributes.paid_at | Invoice | paidAt |
data.attributes.status | Invoice | Deprecated: use statusFlags |
data.attributes.delivery_type | Invoice | N/a |
data.attributes.ready_at | Invoice | N/a |
data.attributes.collected_at | Invoice | N/a |
data.attributes.subtotal | Invoice | subTotalCents |
data.attributes.discount | Invoice | discountCents |
data.attributes.total | Invoice | totalCents |
data.attributes.tax_on_postage | Invoice | taxShippingCents |
data.attributes.tax_total | Invoice | taxTotalCents |
data.attributes.created_at | Invoice | createdAt |
data.attributes.external_id | Invoice | N/a |
data.attributes.tax_inclusive | Invoice | N/a |
data.attributes.message_to_seller | Invoice | buyerMessageToSeller |
data.attributes.seller_id | Invoice | seller.legacyId |
data.attributes.postage_tracking | Invoice | shipments.trackingNumber |
data.attributes.postage_carrier | Invoice | shipments.carrier |
data.attributes.external_ids | Invoice | externalIds.key externalIds.value |
data.attributes.metadata | Invoice | metadata.key metadata.value |
data.relationships.line_items.type | Invoice | __typename |
data.relationships.line_items.id | Invoice | lineItems.legacyId |
data.relationships.shipments.type | Invoice | __typename |
data.relationships.shipments.id | Invoice | shipments.legacyId |
data.relationships.customer.type | Invoice | N/a |
data.relationships.customer.id | Invoice | N/a |
data.relationships.billing_customer.type | Invoice | N/a |
data.relationships.billing_customer.id | Invoice | N/a |
data.relationships.order.type | Invoice | N/a |
data.relationships.order.id | Invoice | N/a |
Included Line Items | ||
included.id | Invoice | legacyId |
included.attributes.price | Invoice | lineItems.itemAmountCents |
included.attributes.status | Invoice | lineItems.status |
included.attributes.subtotal | Invoice | lineItems.subtotalCents |
included.attributes.total | Invoice | lineItems.total |
included.attributes.quantity | Invoice | lineItems.quantity |
included.attributes.taxon_name | Invoice | N/a |
included.attributes.brand_name | Invoice | N/a |
included.attributes.invoice_id | Invoice | legacyId |
included.attributes.advert_name | Invoice | lineItems.advertTitle |
included.attributes.advert_code | Invoice | lineItems.advertCode |
included.attributes.advert_external_id | Invoice | N/a |
included.attributes.variant_name | Invoice | lineItems.variantName |
included.attributes.variant_sku | Invoice | lineItems.variantSku |
included.attributes.variant_barcode | Invoice | lineItems.variantBarcode |
included.attributes.variant_external_id | Invoice | N/a |
included.attributes.tax_total | Invoice | lineItems.taxTotalCents |
included.attributes.original_tax_rate | Invoice | lineItems.taxRate |
included.attributes.external_ids | Invoice | lineItems.externalIds.key lineItems.externalIds.value |
included.attributes.metadata | Invoice | lineItems.metadata.key lineItems.metadata.value |
included.attributes.exposed_metadata | Invoice | N/a |
Included Shipments | ||
included.id | Invoice | shipments.legacyId |
included.attributes.shipment_tracking_number | Invoice | shipments.trackingNumber |
included.attributes.shipment_carrier | Invoice | shipments.carrier |
included.attributes.shipment_tracking_link | Invoice | shipments.trackingLink |
included.attributes.note | Invoice | shipments.note |
included.attributes.dispatched_at | Invoice | shipments.dispatchedAt |
Included Customer | ||
included.id | Invoice | N/a |
included.attributes.first_name | Invoice | buyerFirstName |
included.attributes.surname | Invoice | buyerSurname |
included.attributes.company_name | Invoice | N/a |
included.attributes.email_address | Invoice | buyerEmailAddress |
included.attributes.phone | Invoice | buyerPhone |
included.attributes.address | Invoice | shippingAddress.address |
included.attributes.city | Invoice | shippingAddress.city |
included.attributes.state | Invoice | shippingAddress.state.short |
included.attributes.postcode | Invoice | shippingAddress.postcode |
included.attributes.country | Invoice | shippingAddress.country.name |
Included Billing_Customer | ||
included.id | Invoice | N/a |
included.attributes.first_name | Invoice | N/a |
included.attributes.surname | Invoice | N/a |
included.attributes.company_name | Invoice | N/a |
included.attributes.email_address | Invoice | N/a |
included.attributes.phone | Invoice | N/a |
included.attributes.address | Invoice | buyerBillingAddress.address |
included.attributes.city | Invoice | buyerBillingAddress.city |
included.attributes.state | Invoice | buyerBillingAddress.state.short |
included.attributes.postcode | Invoice | buyerBillingAddress.postcode |
included.attributes.country | Invoice | buyerBillingAddress.country.name |
Included Orders | ||
included.id | Invoice | N/a |
included.attributes.external_ids | Invoice | N/a |
Shipments
Show a single shipment
GET /api/v2/client/invoices/1/shipments/1
REST Field | GraphQL Object | GraphQL Field |
---|---|---|
data.type | Shipment | __typename |
data.id | Shipment | legacyId |
data.attributes.shipment_tracking_number | Shipment | trackingNumber |
data.attributes.shipment_carrier | Shipment | carrier |
data.attributes.shipment_tracking_link | Shipment | trackingLink |
data.attributes.note | Shipment | note |
data.attributes.dispatched_at | Shipment | dispatchedAt |
data.relationships.line_items.type | Shipment | __typename |
data.relationships.line_items.id | Shipment | invoice.lineItems.legacyId |
data.relationships.shipped_items.type | Shipment | __typename |
data.relationships.shipped_items.id | Shipment | N/a |
data.relationships.invoice.type | Shipment | __typename |
data.relationships.invoice.id | Shipment | invoice.legacyId |
Included Line_Items | ||
included.id | Shipment | legacyId |
included.attributes.price | Shipment | invoice.lineItems.itemAmountCents |
included.attributes.status | Shipment | invoice.lineItems.status |
included.attributes.subtotal | Shipment | invoice.lineItems.subtotalCents |
included.attributes.total | Shipment | invoice.lineItems.total |
included.attributes.quantity | Shipment | invoice.lineItems.quantity |
included.attributes.taxon_name | Shipment | N/a |
included.attributes.brand_name | Shipment | N/a |
included.attributes.invoice_id | Shipment | invoice.legacyId |
included.attributes.advert_name | Shipment | invoice.lineItems.advertTitle |
included.attributes.advert_code | Shipment | invoice.lineItems.advertCode |
included.attributes.advert_external_id | Shipment | N/a |
included.attributes.variant_name | Shipment | invoice.lineItems.variantName |
included.attributes.variant_sku | Shipment | invoice.lineItems.variantSku |
included.attributes.variant_barcode | Shipment | invoice.lineItems.variantBarcode |
included.attributes.variant_external_id | Shipment | N/a |
included.attributes.tax_total | Shipment | invoice.lineItems.taxTotalCents |
included.attributes.original_tax_rate | Shipment | invoice.lineItems.taxRate |
included.attributes.external_ids | Shipment | invoice.lineItems.externalIds.key invoice.lineItems.externalIds.value |
included.attributes.metadata | Shipment | invoice.lineItems.metadata.key invoice.lineItems.metadata.value |
included.attributes.exposed_metadata | Shipment | N/a |
Included Shipped_Items | ||
included.id | Shipment | N/a |
included.attributes.quantity | Shipment | shippedItems.quantity |
included.attributes.line_item_id | Shipment | shippedItems.lineItem.legacyId |
Shipping Profiles
Listing shipping profiles
GET /api/v2/shipping_profiles
REST Field | GraphQL Object | GraphQL Field |
---|---|---|
shipping_profile.id | ShippingProfile | legacyId |
shipping_profile.name | ShippingProfile | name |
shipping_profile.description | ShippingProfile | description |
shipping_profile.created_at | ShippingProfile | N/a |
shipping_profile.updated_at | ShippingProfile | N/a |
Taxons
Listing Taxons
GET /api/v2/taxons
REST Field | GraphQL Object | GraphQL Field |
---|---|---|
data.type | Taxon | __typename |
data.id | Taxon | legacyId |
data.attributes.name | Taxon | displayName |
data.attributes.tree_name | Taxon | treeName |
data.attributes.slug | Taxon | urlSlug |
data.attributes.taxon_type | Taxon | taxonType |
Variants
Listing Variants
GET /api/v2/client/variants
REST Field | GraphQL Object | GraphQL Field |
---|---|---|
data.type | Variant | __typename |
data.id | Variant | legacyId |
attributes.sku | Variant | sku |
attributes.count_on_hand | Variant | countOnHand |
attributes.notes | Variant | notes |
attributes.external_id | Variant | externalId |
attributes.sale_price | Variant | lowestPrice |
attributes.price | Variant | lowestOriginalPrice |
attributes.barcode | Variant | barcode |
attributes.ean | Variant | Deprecated: Use barcode |
attributes.upc | Variant | Deprecated: Use barcode |
attributes.advert_id | Variant | advert.legacyId |
attributes.infinite | Variant | infiniteQuantity |
attributes.tax_code | Variant | taxCode |
attributes.item_tax_rate | Variant | itemTaxRate |
attributes.item_tax_rate_percentage | Variant | N/a |
attributes.administrative_body_warning | Variant | administrativeBodyWarning |
attributes.intended_purpose | Variant | intendedPurpose |
attributes.ingredients | Variant | ingredients |
attributes.directions | Variant | directions |
attributes.storage_instructions | Variant | storageInstructions |
attributes.suitable_for | Variant | suitableFor |
attributes.product_warnings | Variant | productWarnings |
attributes.health_warnings | Variant | healthWarnings |
attributes.allergen_contains | Variant | allergenContains |
attributes.allergen_may_contain | Variant | allergenMayContain |
attributes.nutritional_information | Variant | nutritionInformation |
attributes.min_purchase_quantity | Variant | maxPurchaseQuantity |
attributes.max_purchase_quantity | Variant | minPurchaseQuantity |
attributes.item_size | Variant | itemSize |
attributes.comparable_size | Variant | comparableSize |
attributes.sale_price_start_at | Variant | salePriceStartAt |
attributes.sale_price_end_at | Variant | salePriceEndAt |
attributes.name | Variant | label |
attributes.width | Variant | Deprecated: use shippingParcel.width |
attributes.length | Variant | Deprecated: use shippingParcel.length |
attributes.depth | Variant | Deprecated: use shippingParcel.depth |
attributes.weight | Variant | Deprecated: use shippingParcel.width.weight |
attributes.master | Variant | N/a |
attributes.item_unit | Variant | itemUnit |
attributes.comparable_unit | Variant | comparableUnit |
Show a single variant
GET /api/v2/client/variants/1
REST Field | GraphQL Object | GraphQL Field |
---|---|---|
data.type | Variant | __typename |
data.id | Variant | legacyId |
attributes.sku | Variant | sku |
attributes.count_on_hand | Variant | countOnHand |
attributes.notes | Variant | notes |
attributes.external_id | Variant | externalId |
attributes.sale_price | Variant | lowestPrice |
attributes.price | Variant | lowestOriginalPrice |
attributes.barcode | Variant | barcode |
attributes.ean | Variant | Deprecated: Use barcode |
attributes.upc | Variant | Deprecated: Use barcode |
attributes.advert_id | Variant | advert.legacyId |
attributes.infinite | Variant | infiniteQuantity |
attributes.tax_code | Variant | taxCode |
attributes.item_tax_rate | Variant | itemTaxRate |
attributes.item_tax_rate_percentage | Variant | N/a |
attributes.administrative_body_warning | Variant | administrativeBodyWarning |
attributes.intended_purpose | Variant | intendedPurpose |
attributes.ingredients | Variant | ingredients |
attributes.directions | Variant | directions |
attributes.storage_instructions | Variant | storageInstructions |
attributes.suitable_for | Variant | suitableFor |
attributes.product_warnings | Variant | productWarnings |
attributes.health_warnings | Variant | healthWarnings |
attributes.allergen_contains | Variant | allergenContains |
attributes.allergen_may_contain | Variant | allergenMayContain |
attributes.nutritional_information | Variant | nutritionInformation |
attributes.min_purchase_quantity | Variant | maxPurchaseQuantity |
attributes.max_purchase_quantity | Variant | minPurchaseQuantity |
attributes.item_size | Variant | itemSize |
attributes.comparable_size | Variant | comparableSize |
attributes.sale_price_start_at | Variant | salePriceStartAt |
attributes.sale_price_end_at | Variant | salePriceEndAt |
attributes.name | Variant | label |
attributes.width | Variant | Deprecated: use shippingParcel.width |
attributes.length | Variant | Deprecated: use shippingParcel.length |
attributes.depth | Variant | Deprecated: use shippingParcel.depth |
attributes.weight | Variant | Deprecated: use shippingParcel.width.weight |
attributes.master | Variant | N/a |
attributes.item_unit | Variant | itemUnit |
attributes.comparable_unit | Variant | comparableUnit |
Included Variant_Option_Values | ||
included.type | Variant | __typename |
included.id | Variant | variantOptionValues.nodes.optionValue.legacyId |
included.attributes.text_value | Variant | variantOptionValues.nodes.textValue |
included.attributes.name | Variant | variantOptionValues.nodes.optionValue.name |
included.attributes.presentation | Variant | variantOptionValues.nodes.optionValue.presentation |
included.relationships.option_type.data.type | Variant | __typename |
included.relationships.option_type.data.id | Variant | variantOptionValues.nodes.optionType.legacyId |